Loads configs from Etcd into konfig.Store
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,
})