webhook

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Create

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

func NewCreate

func NewCreate(db *sql.DB) Create

NewCreate returns a handle to create and persist a Webhook.

func (Create) ForGet

func (c Create) ForGet(endpoint string, auth string) (*webhook.Webhook, error)

ForGet creates and persist a Webhook to send a GET request.

func (Create) ForPost

func (c Create) ForPost(endpoint string, schema string, contentType string, auth string) (*webhook.Webhook, error)

ForPost creates and persist a Webhook to send a POST request.

func (Create) FromBlueprint

func (c Create) FromBlueprint(bp webhook.Blueprint) (*webhook.Webhook, error)

FromBlueprint creates and persist a Webhook from the Blueprint.

type Find

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

func NewFind

func NewFind(db *sql.DB, defaults ...webhook.Option) Find

NewFind returns a handle to get Webhooks.

func (Find) All

func (f Find) All() (*[]webhook.Webhook, error)

All returns an array of Webhook.

func (Find) ByAddr

func (f Find) ByAddr(addr session.Address) (*[]webhook.Webhook, error)

ByAddr returns Webhooks by Address.

func (Find) ByID

func (f Find) ByID(id webhook.WebhookID) (*webhook.Webhook, error)

ByID returns a Webhook by WebhookID.

Errors

  • If no Webhook found.

func (Find) FindHooks

func (f Find) FindHooks(addr session.Address) ([]session.Hook, error)

type Registry

type Registry struct {
	session.Address
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry(db *sql.DB, addr session.Address) Registry

NewRegistry returns a handle to register a Webhook to the Address.

func (Registry) Create

func (r Registry) Create(id webhook.WebhookID) error

Create registers the Webhook to the Address in the context.

func (Registry) Remove

func (r Registry) Remove(id webhook.WebhookID) error

Remove deletes the Webhook on the Address in the context.

Jump to

Keyboard shortcuts

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