etcd

package
v0.0.0-...-93b1e75 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package etcd is a wrapper around config package and allows reading configuration from some key in etcd server.

Typical usage:

cfg := config.Must(etcd.NewConfig(endpoints, key, encoder))

err = cfg.Get(&myStructure)
if err != nil {
    panic(err)
}

See config package for more details.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoData = errors.New("no data")

ErrNoData error is returned when etcd doesn't have any configuration data by given key.

Functions

func NewConfig

func NewConfig(endpoints []string, key string, encoder config.Encoder) (*config.Config, error)

NewConfig function creates new configuration service using data stored in some key in etcd server and chosen encoder. Most likely you will use one of the predefined encoders: json.Encoder, yaml.Encoder or toml.Encoder.

Types

This section is empty.

Jump to

Keyboard shortcuts

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