Documentation ¶
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") )
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.3.0
Config represents the meta information to pass to the discovery engine
func (Config) GetBool ¶ added in v0.3.0
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 (Config) GetInt ¶ added in v0.3.0
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 (Config) GetMapString ¶ added in v0.3.0
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 ¶ added in v0.3.0
type Provider interface { // ID returns the discovery name ID() string // Initialize initializes the plugin: registers some internal data structures, clients etc. Initialize() error // Register registers this node to a service discovery directory. Register() error // Deregister removes this node from a service discovery directory. Deregister() error // SetConfig registers the underlying discovery options SetConfig(config Config) error // DiscoverPeers returns a list of known nodes. DiscoverPeers() ([]string, error) }
Provider helps discover other running actor system in a cloud environment
type ServiceDiscovery ¶ added in v0.3.0
type ServiceDiscovery struct {
// contains filtered or unexported fields
}
ServiceDiscovery defines the cluster service discovery
func NewServiceDiscovery ¶ added in v0.3.0
func NewServiceDiscovery(provider Provider, config Config) *ServiceDiscovery
NewServiceDiscovery creates an instance of ServiceDiscovery
func (ServiceDiscovery) Config ¶ added in v0.3.0
func (s ServiceDiscovery) Config() Config
Config returns the service discovery config
func (ServiceDiscovery) Provider ¶ added in v0.3.0
func (s ServiceDiscovery) Provider() Provider
Provider returns the service discovery provider