Documentation ¶
Index ¶
- func WithConsulAddr(addr string) func(n *ConsulName)
- func WithConsulID(id string) func(n *ConsulName)
- func WithConsulName(name string) func(n *ConsulName)
- func WithConsulTags(tag []string) func(n *ConsulName)
- func WithGrpcHealthAddr(addr string) func(n *ConsulName)
- func WithHTTPHealthUrl(url string) func(n *ConsulName)
- func WithServiceAddr(addr string) func(n *ConsulName)
- type ConsulName
- type ConsulOption
- type Name
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithConsulAddr ¶
func WithConsulAddr(addr string) func(n *ConsulName)
func WithConsulID ¶
func WithConsulID(id string) func(n *ConsulName)
func WithConsulName ¶
func WithConsulName(name string) func(n *ConsulName)
func WithConsulTags ¶
func WithConsulTags(tag []string) func(n *ConsulName)
func WithGrpcHealthAddr ¶
func WithGrpcHealthAddr(addr string) func(n *ConsulName)
func WithHTTPHealthUrl ¶
func WithHTTPHealthUrl(url string) func(n *ConsulName)
func WithServiceAddr ¶
func WithServiceAddr(addr string) func(n *ConsulName)
Types ¶
type ConsulName ¶
type ConsulName struct { ConsulAddr string ServiceAddr string HTTPHealthUrl string GrpcHealthAddr string Name string Id string Tags []string }
func (*ConsulName) Reg ¶
func (c *ConsulName) Reg() error
func (*ConsulName) ServiceList ¶
func (c *ConsulName) ServiceList() (interface{}, error)
func (*ConsulName) ServicesWithFilter ¶
func (c *ConsulName) ServicesWithFilter(filter string) (interface{}, error)
type ConsulOption ¶
type ConsulOption func(n *ConsulName)
type Name ¶
type Name interface { // 服务注册 Reg() error // 服务列表 ServiceList() (interface{}, error) // 获取某服务 ServicesWithFilter(filter string) (interface{}, error) }
func NewConsulName ¶
func NewConsulName(opts ...ConsulOption) Name
Click to show internal directories.
Click to hide internal directories.