setting

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSections

func GetSections() map[string]interface{}

GetSections return sections.

Types

type Option

type Option func(s *Setting)

Option option func for Setting.

func WithWatchFile

func WithWatchFile(b bool) Option

WithWatchFile 是否监听文件变化

type Setting

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

Setting setting struct

func NewSetting

func NewSetting(dir string, filename string, opts ...Option) (*Setting, error)

NewSetting create a setting entry.

func (*Setting) ReadSection

func (s *Setting) ReadSection(k string, v interface{}) error

ReadSection read section config.

func (*Setting) ReloadAllSection

func (s *Setting) ReloadAllSection() error

ReloadAllSection if config has changed reload all config.

func (*Setting) WatchSettingChange

func (s *Setting) WatchSettingChange()

WatchSettingChange watch file change.

Jump to

Keyboard shortcuts

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