pagerduty

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoValidSignatures is returned when a webhook is not properly signed
	// with the expected signature. When receiving this error, it is reccommended
	// that the server return HTTP 403 to prevent redelivery.
	ErrNoValidSignatures = errors.New("invalid webhook signature")
	// ErrMalformedHeader is returned when the *http.Request is missing the
	// X-PagerDuty-Signature header. When receiving this error, it is recommended
	// that the server return HTTP 400 to prevent redelivery.
	ErrMalformedHeader = errors.New("X-PagerDuty-Signature header is either missing or malformed")
	// ErrMalformedBody is returned when the *http.Request body is either
	// missing or malformed. When receiving this error, it's recommended that the
	// server return HTTP 400 to prevent redelivery.
	ErrMalformedBody = errors.New("HTTP request body is either empty or malformed")
)

Functions

This section is empty.

Types

type Parser

type Parser struct{}

Parser is the GitHub webhook parser.

func (*Parser) GetName

func (p *Parser) GetName() string

GetName returns the parser name.

func (*Parser) Parse

func (p *Parser) Parse(headers map[string][]string, payload []byte) (provider.Event, error)

Parse parses the incoming webhook.

type Validator

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

func NewValidator

func NewValidator(secret string) *Validator

func (*Validator) IsSupported

func (g *Validator) IsSupported(incomingProvider string) bool

func (*Validator) Validate

func (v *Validator) Validate(r *http.Request) error

Jump to

Keyboard shortcuts

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