Skip to content

Instantly share code, notes, and snippets.

@kirshiyin89
Created September 29, 2020 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirshiyin89/4029e0f10262e5f385a958b039f8d67c to your computer and use it in GitHub Desktop.
Save kirshiyin89/4029e0f10262e5f385a958b039f8d67c to your computer and use it in GitHub Desktop.
update an etcd key value pair
setEtcdValue(ConfigData data) {
var key = utf8.encode(data.name);
var value = utf8.encode(data.value);
String _body =
"{\"key\": \"${base64.encode(key)}\", \"value\":\"${base64.encode(value)}\"}";
print(_body);
http.post("http://localhost:2379/v3/kv/put", body: _body);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment