|
|
2 yıl önce | |
|---|---|---|
| .. | ||
| README.md | 2 yıl önce | |
| memory.go | 2 yıl önce | |
| options.go | 2 yıl önce | |
| watcher.go | 2 yıl önce | |
The memory source provides in-memory data as a source
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
}
}
}`)
Specify source with data
memorySource := memory.NewSource(
memory.WithJSON(data),
)
Load the source into config
// Create new config
conf := config.NewConfig()
// Load memory source
conf.Load(memorySource)