model

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

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

Go to latest
Published: Jul 16, 2017 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServicesFailures    = make(map[string]int)
	ServicesRequests    = make(map[string]int)
	ServicesHealthiness = make(map[string]float32)
)

Functions

func LoadServices

func LoadServices() error

LoadServices loads services from file

Types

type Service

type Service struct {
	Name               string   `yaml:"name"`
	Request            string   `yaml:"request-url"`
	POST               bool     `yaml:"post"`
	Timeout            int      `yaml:"timeout"`
	Period             int      `yaml:"period"`
	ContentType        string   `yaml:"content-type"`
	RequestsCount      int      `yaml:"requests-count"`
	FailureCount       int      `yaml:"failures-count"`
	Slacks             []string `yaml:"slacks"`
	Webhooks           []string `yaml:"webhooks"`
	LastRequestsResult []bool
	LastAlert          time.Time
}

Service is container of properties of services

type ServicesListYAML

type ServicesListYAML struct {
	ServicesList []Service `yaml:"services"`
}

ServicesListYAML contains array of services

var (
	// ServicesFilePath is path of config file of services
	ServicesFilePath = "services.yaml"
	// Services contains list of all services
	Services ServicesListYAML
)

Jump to

Keyboard shortcuts

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