utils

package
v0.0.0-...-d2534fa Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAlertBody

func GetAlertBody(message, ServicePath string, labels *model.Sample) ([]byte, error)

func NewPromClient

func NewPromClient(ThanosQueryURL string) (promapi.API, error)

func Query

func Query(promClient promapi.API, promql string) (model.Vector, error)

func SendMessage

func SendMessage(body []byte, url string) error

func SeriesToMany

func SeriesToMany(threshold int) string

Types

type MessageBody

type MessageBody struct {
	ApplicationName string   `json:"applicationName"`
	Env             string   `json:"env"`
	ScheduleTime    string   `json:"scheduleTime"`
	ExpireTime      string   `json:"expireTime"`
	SendAlias       string   `json:"sendAlias"`
	ContextType     string   `json:"contextType"`
	Content         string   `json:"content"`
	Tos             []string `json:"tos"`
	TosType         int32    `json:"tosType"`
	ToParties       []string `json:"toParties"`
}

func (*MessageBody) BuildMessageBody

func (msg *MessageBody) BuildMessageBody(content string, tos, toParties []string) error

Jump to

Keyboard shortcuts

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