alert

package
v0.0.0-...-f62483c Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Action  string  `json:"action"`
	Setting Setting `json:"settings"`
}

type Alert

type Alert struct {
	ID       string    `json:"id,omitempty"`
	Name     string    `json:"name,omitempty"`
	Actions  []Action  `json:"actions,omitempty"`
	Triggers []Trigger `json:"triggers,omitempty"`
	Links    api.Links `json:"links,omitempty"`
}

type Alerts

type Alerts struct {
	Items []Alert   `json:"items"`
	Links api.Links `json:"links"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(client api.HTTP) *Service

func (*Service) Create

func (s *Service) Create(alert Alert) (*Alert, error)

func (*Service) Delete

func (s *Service) Delete(id string) error

func (*Service) Get

func (s *Service) Get(id string) (*Alert, error)

func (*Service) GetAll

func (s *Service) GetAll() (*Alerts, error)

func (*Service) Update

func (s *Service) Update(id string, alert Alert) (*Alert, error)

type Setting

type Setting struct {
	Recipients []string `json:"recipients"`
}

type Trigger

type Trigger struct {
	Metric    string  `json:"metric"`
	Duration  string  `json:"duration"`
	Threshold float64 `json:"threshold"`
}

Jump to

Keyboard shortcuts

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