local

package
v1.10.9 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReloadTypeFsNotify = "fsnotify"
	ReloadTypeTimer    = "timer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AutoReload         bool
	AutoReloadType     ReloadType `json:"autoReloadType" comment:"fsnotify,timer"` // 本地分为Watch和AutoReload,Watch采用系统调用通知,AutoReload定时器去查文件是否变更
	AutoReloadInterval time.Duration
	AutoReloadCallback func(config interface{})
}

type Configor

type Configor struct {
	*Config
	// contains filtered or unexported fields
}

func New

func New(config *Config) *Configor

New initialize a Configor

func (*Configor) Handle

func (configor *Configor) Handle(handle func([]byte), files ...string) (err error)

Load will unmarshal configurations to struct from files that you provide

type ReloadType added in v1.5.11

type ReloadType string

Jump to

Keyboard shortcuts

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