config

package
v0.0.0-...-3377335 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MulanPSL-2.0 Imports: 7 Imported by: 0

README

config

配置项的获取与监听。

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(baseDir string, items []ListenItem)

启动监听

func OnChange

func OnChange(baseDir string, item ListenItem)

监听数据项变化

func ReadToml

func ReadToml(baseDir string, filename string, target interface{}) (err error)

读取TOML文件内容

Types

type ListenItem

type ListenItem struct {
	Filename string                // 文件名,不包含后缀名
	Target   interface{}           // 赋值对象,指针
	OnChange func(filename string) // 发生变化的回调函数
}

监听项配置

Jump to

Keyboard shortcuts

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