consul

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: Apache-2.0 Imports: 4 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
	Token   string
	Path    string
}

Config : configuration for consul Address : address of the consul server Token : token for authentication Path : path in consul to read the configuration from

type ConsulConfigReader

type ConsulConfigReader struct {
	// contains filtered or unexported fields
}

func NewConsulConfigReader

func NewConsulConfigReader(ctx context.Context, config *Config) (*ConsulConfigReader, error)

NewConsulConfigReader creates a new consul configuration reader

func (*ConsulConfigReader) Read

func (a *ConsulConfigReader) Read(ctx context.Context, path string, conf any, configFormat ...common.ConfigFormatType) error

Read reads the configuration from consul path : path in consul 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 (*ConsulConfigReader) Update

func (a *ConsulConfigReader) Update(ctx context.Context, path string, conf any, configFormat ...common.ConfigFormatType) error

Update updates the configuration in consul path : path in consul 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