config

package
v0.0.0-...-6a757b2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT, MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const UnmarshalerNameJSON = "json"

Variables

View Source
var Debug = false
View Source
var ErrConfigPathNotInited = errors.New("config path not inited")
View Source
var WatcherManager = source.NewWatchManager()

Functions

func CleanLoaders

func CleanLoaders()

func InitWatcherManager

func InitWatcherManager()

func Load

func Load(drivername string, file source.Source, v interface{}) error

func LoadAll

func LoadAll(files ...source.Source)

func LoadJSON

func LoadJSON(file source.Source, v interface{}) error

func MustLoadJSON

func MustLoadJSON(file source.Source, v interface{})

func RegisterLoader

func RegisterLoader(file source.Source, loader func(file source.Source))

Types

type ConfigError

type ConfigError struct {
	ConfigPath string
	RawErrror  error
}

func NewError

func NewError(configPath string, rawError error) *ConfigError

func (*ConfigError) Error

func (e *ConfigError) Error() string

type Loader

type Loader struct {
	File     source.Source
	Loader   func(source.Source)
	Position string
	Preload  func()
}

func RegisterLoaderAndWatch

func RegisterLoaderAndWatch(file source.Source, loader func(source.Source)) *Loader

func (*Loader) Load

func (l *Loader) Load()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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