i want to know how we can read all the key and values from ETCD to a Golang Map .i want to create a cache service that can hold this value and i will read from this cache service and not from ETCD directly.
Not sure what you are doing is a great idea, but if you really want…
Write an etcd client that: (1) reads all entries (use client.Get("/") with recursive option), (2) subscribe to all subsequent changes (client.Watch("/") with recursive option).
But… what you are doing is probably not a good idea. etcd works well if you use it directly.
Follow @Giulio_lotti ideia. Avoid create this cache in a map, memory or wherever. ETCD is as hashmap by concept. So it’s great.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.