webhook

package
v0.0.0-...-967dab9 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Webhook

type Webhook struct {
	ID              int
	Title           string
	Key             string
	SignatureHeader string // header containing signature
	Enabled         bool
}

type WebhookEvent

type WebhookEvent struct {
	Body        []byte
	ContentType string
	Signature   string
	Webhook     *Webhook
}

func (*WebhookEvent) CheckPayloadSignature

func (e *WebhookEvent) CheckPayloadSignature() error

CheckPayloadSignature calculates and verifies SHA1 signature of the given payload

func (*WebhookEvent) Process

func (e *WebhookEvent) Process(evt event.EventManager) error

Process a webhook event

type WebhookRepository

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

func NewWebhookRepository

func NewWebhookRepository(database *data.DB) WebhookRepository

func (*WebhookRepository) Delete

func (repo *WebhookRepository) Delete(id int)

func (*WebhookRepository) Fetch

func (repo *WebhookRepository) Fetch(id int) *Webhook

func (*WebhookRepository) FetchAll

func (repo *WebhookRepository) FetchAll() []*Webhook

func (*WebhookRepository) Save

func (repo *WebhookRepository) Save(webhook *Webhook)

Jump to

Keyboard shortcuts

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