Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config : configuration for zookeeper Address : address of the zookeeper server Path : path in zookeeper to read the configuration from Username : username for authentication Password : password for authentication
type ZookeeperReader ¶
type ZookeeperReader struct {
// contains filtered or unexported fields
}
func NewZookeeperReader ¶
func NewZookeeperReader(ctx context.Context, config *Config) (*ZookeeperReader, error)
NewZookeeperReader creates a new zookeeper configuration reader if username and password are provided, it adds authentication to the connection else it connects without authentication
func (*ZookeeperReader) Read ¶
func (a *ZookeeperReader) Read(ctx context.Context, path string, conf any, configFormat ...common.ConfigFormatType) error
Read reads the configuration from zookeeper path : path in zookeeper to read the configuration from conf : configuration object to unmarshal the data into configFormat : format of the configuration data returns error if any returns nil if successful
func (*ZookeeperReader) Update ¶
func (a *ZookeeperReader) Update(ctx context.Context, path string, conf any, configFormat ...common.ConfigFormatType) error
Update updates the configuration in zookeeper path : path in zookeeper to update the configuration conf : configuration object to marshal the data from configFormat : format of the configuration data returns error if any returns nil if successful