zookeeper

package
v1.3.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address  string `yaml:"Address"`
	Path     string `yaml:"Path"`
	Username string `yaml:"Username"`
	Password string `yaml:"Password"`
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL