Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
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