package
0.8.3
Repository: https://github.com/lalamove/konfig.git
Documentation: pkg.go.dev

# README

Etcd Loader

Loads configs from Etcd into konfig.Store

Usage

Basic usage loading keys and using result as string with watcher

etcdLoader := kletcd.New(&kletc.Config{
	Client: etcdClient, // from go.etcd.io/etcd/clientv3 package
	Keys: []Key{
		{
			Key: "foo/bar",
		},
	},
	Watch: true,
})

Loading keys and JSON parser

etcdLoader := kletcd.New(&kletc.Config{
	Client: etcdClient, // from go.etcd.io/etcd/clientv3 package
	Keys: []Key{
		{
			Key: "foo/bar",
			Parser: kpjson.Parser,
		},
	},
	Watch: true,
})

# Functions

New returns a new loader with the given config.

# Structs

Config is the structure representing the config of a Loader.
Key is an Etcd Key to load.
Loader is the structure of a loader.