webhook

package
v3.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHTTPMethod  = errors.New(`invalid http method`)
	ErrWebhookUrlRequired = errors.New(`webhook URL cannot be empty`)
	ErrBadHTTPStatus      = errors.New("bad HTTP status")
)
View Source
var Methods = [6]string{`GET`, `POST`, `PUT`, `HEAD`, `PATCH`, `DELETE`}

Functions

This section is empty.

Types

type Webhook

type Webhook struct {
	Name    string
	Method  string
	Url     string
	Content string
	Header  string
	// contains filtered or unexported fields
}

func New

func New() *Webhook

func (*Webhook) AddHeader

func (w *Webhook) AddHeader(kvs ...string) *Webhook

AddHeader(`headerName=headerValue`)

func (*Webhook) Exec

func (w *Webhook) Exec(contentTagReplacer func(string) string, urlTagReplacer func(string) string) error

func (*Webhook) Validate

func (w *Webhook) Validate() error

Jump to

Keyboard shortcuts

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