Registry /
config / mitchellh-consulstructure
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
consulstructure
✓ github.com/mitchellh/consulstructure
Decode Consul KV data into a struct
package main
import (
"fmt"
"github.com/mitchellh/consulstructure"
)
func main() {
type Config struct {
Host string `json:"host"`
Port int `json:"port"`
}
var cfg Config
consulstructure.Decode("myapp/config", &cfg)
fmt.Println(cfg.Host)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.0.0-20190329231841-56fdc4d2da54latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.