MCPcopy
hub / github.com/olric-data/olric / ServiceDiscovery

Interface ServiceDiscovery

pkg/service_discovery/service_discovery.go:21–43  ·  view source on GitHub ↗

ServiceDiscovery represents an interface for discovering, registering nodes within an Olric cluster.

Source from the content-addressed store, hash-verified

19
20// ServiceDiscovery represents an interface for discovering, registering nodes within an Olric cluster.
21type ServiceDiscovery interface {
22
23 // Initialize prepares the service discovery plugin for use and ensures it is ready for further operations.
24 Initialize() error
25
26 // SetConfig sets the configuration for the service discovery plugin using the provided map of settings.
27 SetConfig(c map[string]interface{}) error
28
29 // SetLogger assigns a custom logger to the service discovery instance for logging operations.
30 SetLogger(l *log.Logger)
31
32 // Register registers the current node in the service discovery directory, enabling it to participate in the cluster.
33 Register() error
34
35 // Deregister removes the current node from the service discovery directory and stops its participation in the cluster.
36 Deregister() error
37
38 // DiscoverPeers retrieves a list of available peers in the cluster and returns their addresses or an error if any occurs.
39 DiscoverPeers() ([]string, error)
40
41 // Close gracefully terminates all operations and releases resources associated with the service discovery instance.
42 Close() error
43}

Callers 6

StartMethod · 0.65
ShutdownMethod · 0.65
JoinMethod · 0.65

Implementers 1

dummyServiceDiscoveryinternal/discovery/discovery_test.go

Calls

no outgoing calls

Tested by

no test coverage detected