loader

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddChecker

func AddChecker(ff func() bool)

func AddLoader

func AddLoader(key string, f func(b []byte) error)

func InitWithLoader

func InitWithLoader(path string, loader ConfigLoaderIF, must bool, liveLoading bool) error

func LoadAll

func LoadAll() error2.Array

func MustInitLocal

func MustInitLocal(path string, liveLoading bool)

func SetLogger

func SetLogger(l *zap.Logger)

Types

type ConfigLoaderIF

type ConfigLoaderIF interface {
	Read(string) ([]byte, error)
	Watch(string, func(string))
}

type LocalLoader

type LocalLoader struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewLocalLoader

func NewLocalLoader() *LocalLoader

func (*LocalLoader) Read

func (p *LocalLoader) Read(path string) ([]byte, error)

func (*LocalLoader) Watch

func (p *LocalLoader) Watch(path string, onChange func(string))

Jump to

Keyboard shortcuts

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