Skip to content

Latest commit

 

History

History
31 lines (28 loc) · 537 Bytes

README.md

File metadata and controls

31 lines (28 loc) · 537 Bytes

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,
})