gh

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrorUnknownType is used when the given type is not supported.
	ErrorUnknownType = errors.New("unknown event type")

	// ErrorNoHeadCommit is used when the the event has no head commit.
	ErrorNoHeadCommit = errors.New("no head commit provided in the event")
)

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. nolint: exhaustivestruct, funlen

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 (g *Validator) Validate(r *http.Request) error

Jump to

Keyboard shortcuts

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