ServiceDiscovery represents an interface for discovering, registering nodes within an Olric cluster.
| 19 | |
| 20 | // ServiceDiscovery represents an interface for discovering, registering nodes within an Olric cluster. |
| 21 | type 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 | } |
no outgoing calls
no test coverage detected