Documentation ¶
Index ¶
- type DeregisterOption
- type DeregisterOptions
- type GetOption
- type GetOptions
- type NewRegistryFunc
- type Option
- func Context(ctx context.Context) Option
- func Endpoints(endpoints []string) Option
- func Logger(l logger.Logger) Option
- func RetryTimes(rTimes uint32) Option
- func Secure(secure bool) Option
- func ServerAddr(addr string) Option
- func TLSConfig(tlsConfig *tls.Config) Option
- func Timeout(timeout time.Duration) Option
- type Options
- type ProcessService
- type RegisterOption
- type RegisterOptions
- type Registry
- type Result
- type Service
- type WatchOption
- type WatchOptions
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeregisterOption ¶
type DeregisterOption func(*DeregisterOptions)
DeregisterOption options' of deregistering service functions
type DeregisterOptions ¶
type DeregisterOptions struct { TTL time.Duration // Other options for implementations of the interface // can be stored in a context Context context.Context }
DeregisterOptions deregister service Options
type NewRegistryFunc ¶
NewRegistryFunc new registry function
type Option ¶
type Option func(*Options)
Option initial options' functions
func RetryTimes ¶
func ServerAddr ¶
type Options ¶
type Options struct { Endpoints []string Timeout time.Duration Secure bool TLSConfig *tls.Config ServerAddr string RetryTimes uint32 // Other options for implementations of the interface // can be stored in a context Context context.Context Logger logger.Logger }
Options new registry Options
type ProcessService ¶
type ProcessService interface { Register(*service.Service, ...RegisterOption) error Deregister(*service.Service, ...DeregisterOption) error Watch(...WatchOption) (Watcher, error) }
ProcessService Process register service
type RegisterOption ¶
type RegisterOption func(*RegisterOptions)
RegisterOption options' of registing service functions
func RegisterHeartbeat ¶
func RegisterHeartbeat(hb time.Duration) RegisterOption
func RegisterTTL ¶
func RegisterTTL(ttl time.Duration) RegisterOption
func RegisterWeight ¶
func RegisterWeight(w uint32) RegisterOption
type RegisterOptions ¶
RegisterOptions regist service Options
func (*RegisterOptions) Check ¶
func (p *RegisterOptions) Check()
type Registry ¶
type Registry interface { Init(...Option) error Options() Options ProcessService Stop() error ID() string String() string }
Registry The registry provides an interface for service discovery and an abstraction over varying implementations {consul, etcd, zookeeper, ...}
type Result ¶
type Result struct { // Id is registry id ID string // Type defines type of event Type service.EventType // Timestamp is event timestamp Timestamp time.Time // Service is registry service Service *Service }
Result is registry result
type Service ¶
type Service struct { service.Service `json:",inline" yaml:",inline"` *node.Node `json:"node" yaml:"node"` }
Service service
type WatchOption ¶
type WatchOption func(*WatchOptions)
WatchOption options' of watching service functions
func WatchLogger ¶
func WatchLogger(l logger.Logger) WatchOption
func WatchService ¶
func WatchService(service service.Service) WatchOption
type WatchOptions ¶
WatchOptions watch service Options
Click to show internal directories.
Click to hide internal directories.