configx

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(key string, typ ConfigType, obj interface{}, watch ...func(string, error)) error

func Must added in v1.0.3

func Must(opts ...Option) error

Types

type Config added in v1.0.3

type Config struct {
	Path  string
	Type  ConfigType
	Watch []func(string, error)
	// contains filtered or unexported fields
}

type ConfigType

type ConfigType string
const (
	Empty            = ""
	Local ConfigType = "config-local"
	Nacos ConfigType = "config-nacos"
)

type Option added in v1.0.3

type Option func(*Options)

func WithLocal added in v1.0.3

func WithLocal(path string, c interface{}) Option

func WithNacos added in v1.0.3

func WithNacos(c interface{}) Option

func WithWatch added in v1.0.3

func WithWatch(watch ...func(string, error)) Option

type Options added in v1.0.3

type Options struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL