Documentation ¶
Index ¶
- Constants
- Variables
- func BuildViolationAttachment(src LibratoOutMessage, violation LibratoOutViolation, violationSuffix string) cc.Attachment
- func ExampleMessage(cfg config.Configuration, data util.ExampleData, eventSlug string) (cc.Message, error)
- func NewHandler() handlers.Handler
- func Normalize(cfg config.Configuration, hReq handlers.HandlerRequest) (cc.Message, error)
- func NormalizeSourceCleared(cfg config.Configuration, src LibratoOutMessage) cc.Message
- func NormalizeSourceTriggered(cfg config.Configuration, src LibratoOutMessage) cc.Message
- type LibratoOutAlert
- type LibratoOutCondition
- type LibratoOutMessage
- type LibratoOutViolation
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 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 LibratoOutCondition ¶
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"` }
Click to show internal directories.
Click to hide internal directories.