package
1.12.6
Repository: https://github.com/go-dev-frame/sponge.git
Documentation: pkg.go.dev

# README

conf

Parsing yaml, json, toml configuration files to go struct.


Example of use

    import "github.com/go-dev-frame/sponge/pkg/conf"

    // Way 1: No listening configuration file
    config := &App{}
    err := conf.Parse("test.yml", config)

    // Way 2: Enable listening configuration file
    config := &App{}
    reloads  := []func(){
        func() {
            fmt.Println("close and reconnect mysql")
            fmt.Println("close and reconnect redis")
        },
    }
    err := conf.Parse("test.yml", config, reloads...)

# Functions

Parse configuration files to struct, including yaml, toml, json, etc., and turn on listening for configuration file changes if fs is not empty.
ParseConfigData parse data to struct.
Show print configuration information (hide sensitive fields).