https://github.com/katallaxie/kvstructure
Go library for transcoding data from KVs (libkv) to data structures and vice versa
https://github.com/katallaxie/kvstructure
etcd golang kv libkv
Last synced: about 1 year ago
JSON representation
Go library for transcoding data from KVs (libkv) to data structures and vice versa
- Host: GitHub
- URL: https://github.com/katallaxie/kvstructure
- Owner: katallaxie
- License: apache-2.0
- Created: 2018-01-09T22:19:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-04-28T21:59:29.000Z (about 5 years ago)
- Last Synced: 2025-05-07T21:04:13.428Z (about 1 year ago)
- Topics: etcd, golang, kv, libkv
- Language: Go
- Homepage:
- Size: 152 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kvstructure
[](https://godoc.org/github.com/andersnormal/kvstructure)
[](https://travis-ci.org/andersnormal/kvstructure)
[](https://twitter.com/SwiftOnSecurity)
[](https://github.com/auchenberg/volkswagen)
[](https://goreportcard.com/report/github.com/andersnormal/kvstructure)
Go library for transcoding data from KVs supported by [libkv](https://github.com/docker/libkv) to `structs`, `string`, `int`, `uint` and `float32` and vice versa.
## Example
```golang
transcoder, err := NewTranscoder(
TranscoderWithKV(kv),
TranscoderWithPrefix("prefix"),
)
if err != nil {
return err
}
tt := &Example{
Description: "bar",
Enabled: true,
}
if err := transcoder.Transcode("foo", &tt) {
return err
}
```
## License
[Apache 2.0](/LICENSE)