Documentation ¶
Index ¶
- func MarshalCommandMeta(data []CommandMeta) (string, error)
- type CommandMeta
- type CommandMetaInfo
- type ConsulDiscovery
- func (d *ConsulDiscovery) Close() error
- func (d *ConsulDiscovery) Deregister(id string) error
- func (d *ConsulDiscovery) DiscoverByMeta(key, value string) ([]Service, error)
- func (d *ConsulDiscovery) DiscoverByName(name string) ([]Service, error)
- func (d *ConsulDiscovery) DiscoverByTag(tag string) ([]Service, error)
- func (d *ConsulDiscovery) DiscoverFilter(filter string) ([]Service, error)
- func (d *ConsulDiscovery) Register(id, name string, host string, port int, meta map[string]string) error
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalCommandMeta ¶
func MarshalCommandMeta(data []CommandMeta) (string, error)
Types ¶
type CommandMeta ¶
type CommandMetaInfo ¶
type CommandMetaInfo []CommandMeta
func ParseCommandMeta ¶
func ParseCommandMeta(data []byte) (*CommandMetaInfo, error)
type ConsulDiscovery ¶
type ConsulDiscovery struct {
// contains filtered or unexported fields
}
func NewConsulClient ¶
func NewConsulClient(address string) (*ConsulDiscovery, error)
NewConsulClient create new Consul consul client
func (*ConsulDiscovery) Close ¶
func (d *ConsulDiscovery) Close() error
func (*ConsulDiscovery) Deregister ¶
func (d *ConsulDiscovery) Deregister(id string) error
Deregister service by ID
func (*ConsulDiscovery) DiscoverByMeta ¶
func (d *ConsulDiscovery) DiscoverByMeta(key, value string) ([]Service, error)
DiscoverByMeta discover services by specified meta
func (*ConsulDiscovery) DiscoverByName ¶
func (d *ConsulDiscovery) DiscoverByName(name string) ([]Service, error)
DiscoverByName discover service by name
func (*ConsulDiscovery) DiscoverByTag ¶
func (d *ConsulDiscovery) DiscoverByTag(tag string) ([]Service, error)
DiscoverByTag discover services by tag
func (*ConsulDiscovery) DiscoverFilter ¶
func (d *ConsulDiscovery) DiscoverFilter(filter string) ([]Service, error)
DiscoverFilter discover service by specified filter
Click to show internal directories.
Click to hide internal directories.