webhook_helper

package
v1.1.11 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownStorageDriver = errors.New("unknown storage driver")
	ErrWebhookNotFound      = errors.New("webhook not found")
)

Functions

func ValidateHmac added in v1.0.0

func ValidateHmac(srt string, req *http.Request) bool

Types

type Event added in v1.0.0

type Event struct {
	*viper.Viper
}

func UnmarshalEvent added in v1.0.0

func UnmarshalEvent(buf []byte) (*Event, error)

type MemoryStorage

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

func (*MemoryStorage) CreateWebhook

func (s *MemoryStorage) CreateWebhook(wh *Webhook) (*Webhook, error)

func (*MemoryStorage) DeleteWebhook

func (s *MemoryStorage) DeleteWebhook(id string) error

func (*MemoryStorage) GetWebhook

func (s *MemoryStorage) GetWebhook(id string) (*Webhook, error)

func (*MemoryStorage) ListWebhooks

func (s *MemoryStorage) ListWebhooks(wh *Webhook) ([]*Webhook, error)

func (*MemoryStorage) UpdateWebhook

func (s *MemoryStorage) UpdateWebhook(id string, wh *Webhook) (*Webhook, error)

type MemoryStorageFactory

type MemoryStorageFactory struct{}

func (*MemoryStorageFactory) New

func (*MemoryStorageFactory) New(args ...interface{}) (Storage, error)

type Storage

type Storage interface {
	CreateWebhook(wh *Webhook) (*Webhook, error)
	DeleteWebhook(id string) error
	ListWebhooks(wh *Webhook) ([]*Webhook, error)
	GetWebhook(id string) (*Webhook, error)
	UpdateWebhook(id string, wh *Webhook) (*Webhook, error)
}

func NewStorage

func NewStorage(name string, args ...interface{}) (Storage, error)

type StorageFactory

type StorageFactory interface {
	New(args ...interface{}) (Storage, error)
}

type Webhook

type Webhook struct {
	Id          *string
	Url         *string
	ContentType *string
	Secret      *string
}

type WebhookService

type WebhookService interface {
	Add(*Webhook) (*Webhook, error)
	Remove(id string) error
	List(*Webhook) ([]*Webhook, error)
	Get(id string) (*Webhook, error)
	Update(id string, wh *Webhook) (*Webhook, error)
	Trigger(evt interface{}) error
}

func NewWebhookService

func NewWebhookService(opt *WebhookServiceOption, args ...interface{}) (WebhookService, error)

type WebhookServiceOption

type WebhookServiceOption struct {
	ContentType string
}

Jump to

Keyboard shortcuts

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