pushover_notificationchannel

package module
v0.0.0-...-3009a32 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README

Google Cloud Monitoring Notification Channel for Pushover)

build-container Go Reference Go Report Card

  • ghcr.io/dazwilkin/go-gcp-pushover-notificationchannel:6c88a0f22c89d22d7a1bdc59d8a3aa44747e3318

See Using Google Monitoring Alerting to send Pushover notifications

Sigstore

go-gcp-pushover-notificationchannel container images are being signed by Sigstore and may be verified:

cosign verify \
--key=./cosign.pub \
ghcr.io/dazwilkin/go-gcp-pushover-notificationchannel:6c88a0f22c89d22d7a1bdc59d8a3aa44747e3318

NOTE cosign.pub may be downloaded here

To install cosign, e.g.:

go install github.com/sigstore/cosign/cmd/cosign@latest


Buy Me A Coffee

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Webhook

func Webhook(w http.ResponseWriter, r *http.Request)

pushover is an HTTP Cloud Function.

Types

type Body

type Body struct {
	Incident Incident `json:"incident"`
}

type Incident

type Incident struct {
	ID           string   `json:"incident_id"`
	ProjectID    string   `json:"scoping_project_id"`
	ProjectNum   string   `json:"scoping_project_number"`
	URL          string   `json:"url"`
	Started      int      `json:"started_at"`
	Ended        int      `json:"ended_at"`
	State        string   `json:"state"`
	Summary      string   `json:"summary"`
	ResourceID   string   `json:"resource_id"`
	ResourceName string   `json:"resource_name"`
	Resource     Resource `json:"resource"`
	Metric       Metric   `json:"metric"`
	Metadata     Metadata `json:"metadata"`
}

type Message

type Message struct {
	ProjectID    string
	State        string
	Summary      string
	Started      int
	Ended        int
	SystemLabels map[string]string
}

Message is a type that represents the Pushover message

func NewMessage

func NewMessage(body *Body) (*Message, error)

NewMessage is a function that maps an Incident body into a Pushover message

type Metadata

type Metadata struct {
	SystemLabels map[string]string `json:"system_labels"`
	UserLabels   map[string]string `json:"user_labels"`
}

type Metric

type Metric struct {
	Type   string            `json:"type"`
	Labels map[string]string `json:"labels"`
}

type Resource

type Resource struct {
	Type   string            `json:"type"`
	Labels map[string]string `json:"labels"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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