package
1.5.2
Repository: https://github.com/go-sanpang/go-admin-core.git
Documentation: pkg.go.dev

# README

测试用例:

import (
	"fmt"
	"testing"
	
	"github.com/go-sanpang/go-admin-core/config"
	"github.com/go-sanpang/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.

# Structs

Options 配置的参数.

# Interfaces

Config is an interface abstraction for dynamic configuration.
Entity 配置实体.
Watcher is the config watcher.

# Type aliases

Option 调用类型.