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: 4 Imported by: 0

Documentation

Overview

Package etcd is a wrapper around config package and allows reading configuration from some key in etcd server and parsing it with some encoder, where endpoints and key are defined in environment variables.

Used environment variables: CONFIG_ETCD_ENDPOINTS - etcd endpoints separated with comma. Default is '127.0.0.1:2379'. CONFIG_ETCD_KEY - key in etcd server where configuration data is stored. Default is 'config'.

Typical usage:

cfg := config.Must(etcd.NewConfig(encoder))

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

See config package for more details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfig

func NewConfig(encoder config.Encoder) (*config.Config, error)

NewConfig function creates new configuration service from some key in etcd server. Use CONFIG_ETCD_ENDPOINTS environment variable to define etcd endpoints. Default is '127.0.0.1:2379'. Use CONFIG_ETCD_KEY environment variable to define key where configuration data is stored. Default is 'config'.

Types

This section is empty.

Jump to

Keyboard shortcuts

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