package
0.0.0-20241123081934-5b2a99bd3a3f
Repository: https://github.com/nextpkg/nextcfg.git
Documentation: pkg.go.dev
# README
Memory Source
The memory s provides in-memory data as a s
Memory Format
The expected data format is json
data := []byte(`{
"hosts": {
"database": {
"address": "10.0.0.1",
"port": 3306
},
"cache": {
"address": "10.0.0.2",
"port": 6379
}
}
}`)
New Source
Specify s with data
memorySource := memory.NewSource(
memory.WithJSON(data),
)
Load Source
Load the s into config
// Create new config
conf := nextcfg.NewConfig()
// Load memory s
conf.Load(memorySource)
# Functions
GetLoader sets memory source.
NewSource ...
WithChangeSet allows a change set to be set.
WithJSON allows the source data to be set to json.
WithYAML allows the source data to be set to yaml.