vsco / jsonconsul Goto Github PK
View Code? Open in Web Editor NEWGenerate JSON config via Consul KVs
License: MIT License
Generate JSON config via Consul KVs
License: MIT License
I'd like the ability to connect to a consul server other than localhost, it seems that consul.go
will only use the default configuration options:
func init() {
var (
err error
)
client, err = api.NewClient(api.DefaultConfig())
if err != nil {
log.Fatalln(err)
}
kv = client.KV()
}
Hi can you please give me installation steps for jsonconsul on ubuntu Machine.
Need to be able to create KV pairs in Consul using JSON input. This will allow updating consul with values as needed.
I have below json
{
"Month": {
"Name": "January"
},
"Week":{
"Day": [ "Monday", "Tuesday", "Wednesday" ]
}
}
I would like to import above json using command , currently it is considering "Week/Day" as key and value is "[ "Monday", "Tuesday", "Wednesday" ]". but actually key should be like
Week/Day[0] = "Monday"
Week/Day[1] = "Tuesday"
Week/Day[2] = "Wednesday"
Did you handled if json contains list ? Is there any plan to implement
make
go get -d -v
go build -ldflags="-X main.Version v0.4.1" -o bin/jsonconsul cmd/*.go
# github.com/vsco/jsonconsul
/Users/cchan/go/src/github.com/vsco/jsonconsul/export_watch.go:34:10: undefined: dependency.StoreKeyPrefix
like this, many empty key value pair in output json
{
"users": {
"15d99242e9f7235d220d": {
"": "",
"id": "15d99242e9f7235d220d"
},
"166e8c2e5ca2eaa67376": {
"": "",
"id": "166e8c2e5ca2eaa67376"
},
"99d3bd56485b8f3893cf": {
"": "",
"id": "99d3bd56485b8f3893cf"
}
}
}
Be able to see the diffs between what is in consul and what a json file are.
Downloaded a release and tried to run ./jsonconsul export -json-values -prefix="helios"
panic: interface conversion: interface is string, not map[string]interface {}
goroutine 1 [running]:
github.com/vsco/jsonconsul.consulToNestedMap(0x0, 0x0, 0xc20804a101, 0xc20803cae0, 0x0, 0x0)
/Users/abhi/Dropbox/projects/gostuff/src/github.com/vsco/jsonconsul/consul.go:64 +0x747
github.com/vsco/jsonconsul.(*JsonExport).GenerateJson(0xc2080440f0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/abhi/Dropbox/projects/gostuff/src/github.com/vsco/jsonconsul/export.go:107 +0x8d
github.com/vsco/jsonconsul.(*JsonExport).Run(0xc2080440f0, 0x0, 0x0)
/Users/abhi/Dropbox/projects/gostuff/src/github.com/vsco/jsonconsul/export.go:128 +0x4b
main.main()
/Users/abhi/Dropbox/projects/gostuff/src/github.com/vsco/jsonconsul/cmd/main.go:42 +0x1b0
goroutine 7 [runnable]:
net/http.(*persistConn).readLoop(0xc20806e0b0)
/Users/abhi/vsco/tools/vendor/go/1.4.2/src/net/http/transport.go:928 +0x9ce
created by net/http.(*Transport).dialConn
/Users/abhi/vsco/tools/vendor/go/1.4.2/src/net/http/transport.go:660 +0xc9f
goroutine 8 [select]:
net/http.(*persistConn).writeLoop(0xc20806e0b0)
/Users/abhi/vsco/tools/vendor/go/1.4.2/src/net/http/transport.go:945 +0x41d
created by net/http.(*Transport).dialConn
/Users/abhi/vsco/tools/vendor/go/1.4.2/src/net/http/transport.go:661 +0xcbc
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.