config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Common    config.Common `toml:"common"`
	Listener  HTTP          `toml:"http"`
	Processor Processor     `toml:"processor"`
	Operators Operators     `toml:"operators"`
	Entities  Entities      `toml:"entities"`
}

Config -- application config

func Get

func Get() *Config

Get --

func (*Config) Check

func (cfg *Config) Check() (err error)

Check -- check application config

type Entities

type Entities []*Entity

Entities -- objects list

func (Entities) Check

func (x Entities) Check(cfg *Config) error

Check -- check entities config

type Entity

type Entity struct {
	Idx            int    `toml:"-"`
	ID             uint   `toml:"id"`
	Enabled        bool   `toml:"enabled"`
	Name           string `toml:"name"`
	Description    string `toml:"description"`
	Type           string `toml:"type"`
	Delay          uint   `toml:"delay"`
	AlertLevelHigh int    `toml:"alert-level-high"`
	AlertLevelLow  int    `toml:"alert-level-low"`
	Login          string `toml:"login"`
	Password       string `toml:"password"`
	Schedule       string `toml:"schedule"`
}

Entity -- object

func (*Entity) Check

func (x *Entity) Check(cfg *Config) error

Check -- check entity config

type HTTP

type HTTP struct {
	Listener config.Listener `toml:"listener"`
}

HTTP -- http listener config

func (*HTTP) Check

func (x *HTTP) Check(cfg *Config) error

Check -- check http listener config

type Operator

type Operator struct {
	Description string   `toml:"description"`
	Timeout     uint     `toml:"timeout"`
	Tasks       []string `toml:"tasks"`
}

Operator --

func (*Operator) Check

func (x *Operator) Check(cfg *Config) error

Check -- check operators config

type Operators

type Operators map[string]*Operator

Operators --

func (Operators) Check

func (x Operators) Check(cfg *Config) error

Check -- check operators config

type Processor

type Processor struct {
	TimeZoneInfoFile string `toml:"tz-info-file"`
	CronLocation     string `toml:"cron-location"`
	Schedule         string `toml:"schedule"`
	ViewBrowser      bool   `toml:"view-browser"`
	StdTimeout       uint   `toml:"std-timeout"`

	DB string `toml:"db"`

	TemplatesDir string   `toml:"templates-dir"`
	Templates    []string `toml:"-"`
}

Processor -- processor options

func (*Processor) Check

func (x *Processor) Check(cfg *Config) error

Check -- check processor config

Jump to

Keyboard shortcuts

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