Documentation ¶
Overview ¶
Package discovery provides the interface to discover other groupcache nodes in the cluster
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAlreadyInitialized is used when attempting to re-initialize the discovery provider ErrAlreadyInitialized = errors.New("provider already initialized") // ErrNotInitialized is used when the provider is not initialized ErrNotInitialized = errors.New("provider not initialized") // ErrAlreadyRegistered is used when attempting to re-register the provider ErrAlreadyRegistered = errors.New("provider already registered") // ErrNotRegistered is used when attempting to de-register the provider ErrNotRegistered = errors.New("provider is not registered") )
Functions ¶
This section is empty.
Types ¶
type Discovery ¶
type Discovery struct {
// contains filtered or unexported fields
}
Discovery defines the cluster service discovery
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node defines the discovered node
type NodeAdded ¶
type NodeAdded struct { // Node specifies the added node Node *Node }
NodeAdded discovery lifecycle event
type NodeModified ¶
type NodeModified struct { // Node specifies the modified node Node *Node // Current specifies the existing nde Current *Node }
NodeModified discovery lifecycle event
func (NodeModified) IsEvent ¶
func (e NodeModified) IsEvent()
type NodeRemoved ¶
type NodeRemoved struct { // Node specifies the removed node Node *Node }
NodeRemoved discovery lifecycle event
func (NodeRemoved) IsEvent ¶
func (e NodeRemoved) IsEvent()
type Options ¶
Options represents the meta information to pass to the discovery engine
func (Options) GetBool ¶
GetBool returns the int value of a given key which value is a boolean If the key value is not a boolean then an error is return
func (Options) GetInt ¶
GetInt returns the int value of a given key which value is an integer If the key value is not an integer then an error is return
func (Options) GetMapString ¶
GetMapString returns the map of string value of a given key which value is a map of string Map of string means that the map key value pair are both string
type Provider ¶
type Provider interface { // ID returns the service discovery provider name ID() string // Initialize initializes the service discovery provider. Initialize() error // Register registers the service discovery provider. Register() error // Deregister de-registers the service discovery provider. Deregister() error // SetConfig registers the underlying discovery options SetConfig(config Options) error // DiscoverNodes returns a list discovered nodes DiscoverNodes() ([]*Node, error) // Watch returns event based upon node lifecycle Watch(ctx context.Context) (<-chan Event, error) // Close closes the provider Close() error }
Provider helps discover other nodes in a cloud environment
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package kubernetes defines the kubernetes discovery provider
|
Package kubernetes defines the kubernetes discovery provider |
Package mdns defines the mdns discovery provider
|
Package mdns defines the mdns discovery provider |