Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RoundRobin ¶ added in v1.2.4
type RoundRobin struct {
// contains filtered or unexported fields
}
func (*RoundRobin) Add ¶ added in v1.2.4
func (r *RoundRobin) Add(s string)
func (*RoundRobin) Clear ¶ added in v1.2.4
func (r *RoundRobin) Clear()
func (*RoundRobin) Pick ¶ added in v1.2.4
func (r *RoundRobin) Pick() string
type ServiceDiscovery ¶
type ServiceDiscovery struct {
// contains filtered or unexported fields
}
func NewClientDiscovery ¶ added in v1.2.4
func NewClientDiscovery(serviceName string, endpoints []string) (*ServiceDiscovery, error)
func (*ServiceDiscovery) Build ¶
func (s *ServiceDiscovery) Build() error
func (*ServiceDiscovery) DelServiceList ¶
func (s *ServiceDiscovery) DelServiceList(key string)
func (*ServiceDiscovery) GetServerAddr ¶ added in v1.2.4
func (s *ServiceDiscovery) GetServerAddr() (string, error)
GetServerAddr return grpc server ip
func (*ServiceDiscovery) SetServiceList ¶
func (s *ServiceDiscovery) SetServiceList(key, val string)
type ServiceOption ¶
type ServiceOption struct { Endpoints []string // etcd host Lease int64 // etcd lease Prefix string // prefix,ex:serviceName Port int // grpc server port DialTimeout time.Duration // DialTimeout second }
ServiceOption service register options
type ServiceRegister ¶
type ServiceRegister struct {
// contains filtered or unexported fields
}
func NewServiceRegister ¶
func NewServiceRegister(opt *ServiceOption) (*ServiceRegister, error)
NewServiceRegister return a *ServiceRegister and error
func (*ServiceRegister) Close ¶
func (s *ServiceRegister) Close() error
Close initiative close the lease
func (*ServiceRegister) ListenLeaseRespChan ¶
func (s *ServiceRegister) ListenLeaseRespChan()
ListenLeaseRespChan listen the lease chan
Click to show internal directories.
Click to hide internal directories.