config

package
v0.0.0-...-b579be4 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2019 License: MIT, MIT, MIT, + 1 more Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Create = Op(fsnotify.Create)
	Write  = Op(fsnotify.Write)
	Remove = Op(fsnotify.Remove)
	Rename = Op(fsnotify.Rename)
	Chmod  = Op(fsnotify.Chmod)
)
View Source
var Debug = false

Functions

func LoadAll

func LoadAll()

func LoadJSON

func LoadJSON(path string, v interface{}) error

func MustLoadJSON

func MustLoadJSON(path string, v interface{})

func RegisterLoader

func RegisterLoader(path string, loader func(path string))

Types

type ConfigError

type ConfigError struct {
	ConfigPath string
	RawErrror  error
}

func NewError

func NewError(configPath string, rawError error) *ConfigError

func (*ConfigError) Error

func (e *ConfigError) Error() string

type Event

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

func (*Event) IsChmod

func (e *Event) IsChmod() bool

func (*Event) IsCreate

func (e *Event) IsCreate() bool

func (*Event) IsReName

func (e *Event) IsReName() bool

func (*Event) IsRemove

func (e *Event) IsRemove() bool

func (*Event) IsWrite

func (e *Event) IsWrite() bool

func (*Event) Path

func (e *Event) Path() string

type Loader

type Loader struct {
	Path     string
	Loader   func(path string)
	Position string
}

func (*Loader) Load

func (l *Loader) Load()

type LoaderWatcher

type LoaderWatcher struct {
	Loader   *Loader
	Watcher  *WatcherManager
	Callback func(Event)
}

func RegisterLoaderAndWatch

func RegisterLoaderAndWatch(path string, loader func(path string)) *LoaderWatcher

func (*LoaderWatcher) Load

func (l *LoaderWatcher) Load()

type Op

type Op uint32

Op describes a set of file operations.

type WatcherManager

type WatcherManager struct {
	*fsnotify.Watcher
	// contains filtered or unexported fields
}
var Watcher *WatcherManager

func NewWatcherManager

func NewWatcherManager() (*WatcherManager, error)

func (*WatcherManager) On

func (w *WatcherManager) On(path string, callback func(event Event))

func (*WatcherManager) Start

func (w *WatcherManager) Start()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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