config

package
v0.0.0-...-2e7da14 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrLoadFailed .
	ErrLoadFailed = errors.New("load failed")

	// ErrCheckFailed .
	ErrCheckFailed = errors.New("check failed")
)

Functions

This section is empty.

Types

type CheckConfig

type CheckConfig struct {
	// Name should be unique in the config
	Name   string                 `json:"name"`
	Type   string                 `json:"type"`
	Config map[string]interface{} `json:"config"`
}

CheckConfig has the structure of the config file

type Checker

type Checker interface {
	Init(conf map[string]interface{}) error
	Check() error
}

Checker .

type Conf

type Conf struct {
	CheckTime time.Duration
	Configs   []CheckConfig
}

Conf .

func ReadConfig

func ReadConfig(r io.Reader) (Conf, error)

ReadConfig form an io.Reader

Jump to

Keyboard shortcuts

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