Documentation ¶
Index ¶
- Constants
- func Init(consulAddress string) *consulapi.Client
- func NewDiscovery(name, serviceName string, meta map[string]string, localIp string, port int, ...) proto.IDiscovery
- func NewRegistration(name, serviceName string, tags []string, meta map[string]string, advt string, ...) proto.IRegister
- type Discovery
- type Registration
- func (reg *Registration) GetAddr() string
- func (reg *Registration) GetAddressWithPort() string
- func (reg *Registration) GetHost() string
- func (reg *Registration) GetMeta() map[string]string
- func (reg *Registration) GetMetaValue(key string) string
- func (reg *Registration) GetName() string
- func (reg *Registration) GetPort() int
- func (reg *Registration) GetService(blocking bool) ([]proto.IService, error)
- func (reg *Registration) GetServiceName() string
- func (reg *Registration) GetTags() []string
- func (reg *Registration) Register(nodeName, serviceName string, tags []string, meta map[string]string, ...)
- func (reg *Registration) Unregister()
- type Service
- func (sv *Service) GetAddr() string
- func (sv *Service) GetHost() string
- func (sv *Service) GetMeta() map[string]string
- func (sv *Service) GetMetaValue(key string) string
- func (sv *Service) GetName() string
- func (sv *Service) GetPort() int
- func (sv *Service) GetServiceName() string
- func (sv *Service) GetTags() []string
Constants ¶
View Source
const (
DEFAULT_CONSUL = "consul.rightpaddle.cn:8500"
)
Variables ¶
This section is empty.
Functions ¶
func NewDiscovery ¶
Types ¶
type Registration ¶
type Registration struct { Id string ServiceName string Advt string Port int Meta map[string]string Tags []string LastIndex uint64 // contains filtered or unexported fields }
func (*Registration) GetAddr ¶
func (reg *Registration) GetAddr() string
func (*Registration) GetAddressWithPort ¶ added in v0.1.6
func (reg *Registration) GetAddressWithPort() string
func (*Registration) GetHost ¶ added in v0.1.3
func (reg *Registration) GetHost() string
func (*Registration) GetMeta ¶
func (reg *Registration) GetMeta() map[string]string
func (*Registration) GetMetaValue ¶ added in v0.1.1
func (reg *Registration) GetMetaValue(key string) string
func (*Registration) GetName ¶
func (reg *Registration) GetName() string
func (*Registration) GetPort ¶ added in v0.1.3
func (reg *Registration) GetPort() int
func (*Registration) GetService ¶
func (reg *Registration) GetService(blocking bool) ([]proto.IService, error)
func (*Registration) GetServiceName ¶ added in v0.1.6
func (reg *Registration) GetServiceName() string
func (*Registration) GetTags ¶ added in v0.1.1
func (reg *Registration) GetTags() []string
func (*Registration) Unregister ¶
func (reg *Registration) Unregister()
Click to show internal directories.
Click to hide internal directories.