librato

package
v0.8.12 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DisplayName      = "Librato"
	HandlerKey       = "librato"
	MessageDirection = "out"
	DocumentationURL = "https://www.runscope.com/docs/api-testing/notifications#webhook"
	MessageBodyType  = models.JSON
)

Variables

View Source
var (
	IncludeRecordedAt = false
)

Functions

func BuildViolationAttachment

func BuildViolationAttachment(src LibratoOutMessage, violation LibratoOutViolation, violationSuffix string) cc.Attachment

func ExampleMessage

func ExampleMessage(cfg config.Configuration, data util.ExampleData, eventSlug string) (cc.Message, error)

func NewHandler

func NewHandler() handlers.Handler

func Normalize

func Normalize(cfg config.Configuration, hReq handlers.HandlerRequest) (cc.Message, error)

func NormalizeSourceCleared

func NormalizeSourceCleared(cfg config.Configuration, src LibratoOutMessage) cc.Message

func NormalizeSourceTriggered

func NormalizeSourceTriggered(cfg config.Configuration, src LibratoOutMessage) cc.Message

Types

type LibratoOutAlert

type LibratoOutAlert struct {
	ID         int64  `json:"id,omitempty"`
	Name       string `json:"name,omitempty"`
	RunbookURL string `json:"runbook_url,omitempty"`
	Version    int64  `json:"version,omitempty"`
}

type LibratoOutCondition

type LibratoOutCondition struct {
	ID        int64   `json:"id,omitempty"`
	Type      string  `json:"type,omitempty"`
	Threshold float64 `json:"threshold,omitempty"`
	Duration  int64   `json:"duration,omitempty"`
}

type LibratoOutMessage

type LibratoOutMessage struct {
	Alert         LibratoOutAlert                  `json:"alert,omitempty"`
	Account       string                           `json:"account,omitempty"`
	TriggerTime   int64                            `json:"trigger_time,omitempty"`
	Conditions    []LibratoOutCondition            `json:"conditions,omitempty"`
	ConditionsMap map[int64]LibratoOutCondition    `json:"-,omitempty"`
	Violations    map[string][]LibratoOutViolation `json:"violations,omitempty"`
	Clear         string                           `json:"clear,omitempty"`
}

func LibratoOutMessageFromBytes

func LibratoOutMessageFromBytes(bytes []byte) (LibratoOutMessage, error)

func (*LibratoOutMessage) GetCondition

func (msg *LibratoOutMessage) GetCondition(conditionID int64) (LibratoOutCondition, error)

func (*LibratoOutMessage) Inflate

func (msg *LibratoOutMessage) Inflate()

type LibratoOutViolation

type LibratoOutViolation struct {
	Name              string
	Metric            string  `json:"metric,omitempty"`
	Value             float64 `json:"value,omitempty"`
	RecordedAt        int64   `json:"recorded_at,omitempty"`
	ConditionViolated int64   `json:"condition_violated,omitempty"`
	Count             int64   `json:"count,omitempty"`
	Begin             int64   `json:"begin,omitempty"`
	End               int64   `json:"end,omitempty"`
}

Jump to

Keyboard shortcuts

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