# README
测试用例:
import (
"fmt"
"testing"
"github.com/goodbigtree/go-admin-core/config"
"github.com/goodbigtree/go-admin-core/config/source/file"
)
func TestApp(t *testing.T) {
c, err := config.NewConfig()
if err != nil {
t.Error(err)
}
err = c.Load(file.NewSource(file.WithPath("config/settings.yml")))
if err != nil {
t.Error(err)
}
fmt.Println(c.Map())
}
# Packages
Package encoder handles source encoding formats.
package loader manages loading from multiple sources.
Package reader parses change sets and provides config values.
Package secrets is an interface for encrypting and decrypting secrets.
Package source is the interface for sources.
# Functions
Bytes Return config as raw json.
Get a value from the config.
Load config sources.
LoadFile is short hand for creating a file source and loading it.
Map Return config as a map.
NewConfig returns new config.
Scan values to a go type.
Sync Force a source changeset sync.
Watch a value for changes.
WithEntity sets the config Entity.
WithLoader sets the loader for manager config.
WithReader sets the config reader.
WithSource appends a source to list of sources.
# Variables
DefaultConfig Default Config Manager.
# Type aliases
Option 调用类型.