loader

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfLocalLoader = "local"
	ConfPathSep     = "|"
)
View Source
const (
	LocalLoader = "local"
	HttpLoader  = "http"
)

Variables

This section is empty.

Functions

func BindLoader

func BindLoader(loaderType string, loader util.StrToBytesErr)

func BindParser

func BindParser(assetType string, marshaller util.BytesToAnyErr)

func ConvertConfLocalPath

func ConvertConfLocalPath(paths ...string) []string

func DefaultLoad

func DefaultLoad(assetType string, action util.FnStrAny, paths ...string)

func Load

func Load(assetType string, loaderType string, action util.FnStrAny, paths ...string)

func LoadConf

func LoadConf(conf any, paths ...string)

func SetConfLoader

func SetConfLoader(typ string, loader ConfLoader)

func SetConfPathParser

func SetConfPathParser(parser util.StrToStr2Err)

func SetConfRoot

func SetConfRoot(p string)

func SetDefaultLoader

func SetDefaultLoader(defaultType string)

Types

type ConfLoader

type ConfLoader func(path string, v *viper.Viper) *util.Err

func GetConfLoader

func GetConfLoader(typ string) ConfLoader

type Loader

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

func NewLoader

func NewLoader(defaultType string) *Loader

func (*Loader) BindLoader

func (l *Loader) BindLoader(loaderType string, loader util.StrToBytesErr)

func (*Loader) BindParser

func (l *Loader) BindParser(assetType string, marshaller util.BytesToAnyErr)

func (*Loader) DefaultLoad

func (l *Loader) DefaultLoad(assetType string, action util.FnStrAny, paths ...string)

func (*Loader) Load

func (l *Loader) Load(assetType string, loaderType string, action util.FnStrAny, paths ...string)

Jump to

Keyboard shortcuts

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