webhook

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Secret string
}

Config represents config values for the webhook parser.

type Parser

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

Parser represents a service wrapping the github package providing convenience methods for interacting with Push Events.

func NewParser

func NewParser(secure bool, config Config) (*Parser, error)

NewParser creates a Parser struct with injection of options. In production, secure should be true, but for testing and local development it can be false.

func (*Parser) IsPingEvent added in v0.1.5

func (p *Parser) IsPingEvent(r *http.Request) bool

IsPingEvent determines if the event is a Ping event by attempting to parse it.

func (*Parser) ValidateAndParsePushEvent

func (p *Parser) ValidateAndParsePushEvent(r *http.Request) (github.PushPayload, error)

ValidateAndParsePushEvent is a convenience method for receiving an http request, ensuring it is specifically a Push Event payload and returning it as that struct.

Jump to

Keyboard shortcuts

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