config

package
v0.0.0-...-74dfc27 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentTypeJSON = "application/json"
)

Variables

This section is empty.

Functions

func LoadServices

func LoadServices(configDir string) (services map[string]*Service, err error)

Types

type Call

type Call struct {
	URI         string
	URL         string
	Method      string
	Data        interface{}
	ContentType string `yaml:"content-type"`
	Check       []Check
	Header      map[string][]string
}

func (*Call) GetURL

func (c *Call) GetURL() (u *url.URL, e error)

func (*Call) IsValid

func (c *Call) IsValid() (valid bool, err error)

type Check

type Check struct {
	Comment     string
	JSONPath    map[string]Expect `yaml:"json-path"`
	Goquery     map[string]Expect
	Header      map[string][]string
	Regex       map[string]Expect
	Duration    time.Duration
	StatusCode  int64
	ContentType string `yaml:"content-type"`
}

type Expect

type Expect struct {
	Max      *int64
	Min      *int64
	Count    *int64
	Contains string
	Equals   interface{}
}

type Server

type Server struct {
	Address       string
	BasicAuthFile string
	TLS           *struct {
		Address string
		Cert    string
		Key     string
	}
}

func LoadServer

func LoadServer(configDir string) (server *Server, err error)

type Service

type Service struct {
	ID       string
	Endpoint string
	Interval time.Duration
	Session  []Call
}

Service a service to monitor

func (*Service) GetURL

func (s *Service) GetURL() (u *url.URL, e error)

func (*Service) IsValid

func (s *Service) IsValid() (valid bool, err error)

Jump to

Keyboard shortcuts

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