options

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: Apache-2.0 Imports: 0 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpOption added in v0.4.1

type OpOption func(o *OpOptions)

func WithOpOnChangeFn added in v0.4.1

func WithOpOnChangeFn(inp func(cfg interface{})) OpOption

func WithOpOnErrorFn added in v0.4.1

func WithOpOnErrorFn(inp func(error)) OpOption

type OpOptions added in v0.4.1

type OpOptions struct {
	OnChangeFn func(interface{}) // call it when the file is modified
	OnErrorFn  func(error)       // call it when an error occurs
}

type Option

type Option func(o *Options)

func WithCfgSource added in v0.2.0

func WithCfgSource(inp ...string) Option

func WithCheckInterval

func WithCheckInterval(inp int64) Option

func WithMemoryVariable added in v0.5.0

func WithMemoryVariable(inp interface{}) Option

this is valid only if the parser is MemParser

func WithOnChangeFn

func WithOnChangeFn(inp func(cfg interface{})) Option

func WithOnErrorFn

func WithOnErrorFn(inp func(error)) Option

type Options

type Options struct {
	Sources        []string          // config source
	MemoryVariable interface{}       // memory reference data
	CheckInterval  int64             // file update check interval
	OnChangeFn     func(interface{}) // call it when the file is modified
	OnErrorFn      func(error)       // call it when an error occurs
}

Jump to

Keyboard shortcuts

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