webhook

package
v0.0.0-...-8c17a97 Latest Latest
Warning

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

Go to latest
Published: May 28, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package webhook implements webhook API endpoints.

Note docs say "Mailgun imposes a rate limit for the Webhook API endpoint. Users may issue no more than 300 requests per minute, per account."

Callers with grave concerns about this should see bugs section.

Index

Constants

View Source
const (
	Bounce      = hook(`bounce`)
	Deliver     = hook(`deliver`)
	Drop        = hook(`drop`)
	Spam        = hook(`spam`)
	Unsubscribe = hook(`unsubscribe`)
	Click       = hook(`click`)
	Open        = hook(`open`)
)

Webhook names.

Variables

This section is empty.

Functions

func Delete

func Delete(c client.Caller, name Hook) error

Delete webhook.

func New

func New(c client.Caller, name Hook, url string) error

New creates a new webhook for name.

func URL

func URL(c client.Caller, name Hook) (fmt.Stringer, error)

URL returns the URL for webhook name.

func Update

func Update(c client.Caller, name Hook, url string) error

Update webhook url.

Types

type Hook

type Hook interface {
	// contains filtered or unexported methods
}

Hook is an interface for webhook names.

type Webhook

type Webhook struct {
	URL string `json:"url"`
}

Webhook is a webhook URL.

type Webhooks

type Webhooks struct {
	Bounce      Webhook `json:"bounce"`
	Deliver     Webhook `json:"deliver"`
	Drop        Webhook `json:"drop"`
	Spam        Webhook `json:"spam"`
	Unsubscribe Webhook `json:"unsubscribe"`
	Click       Webhook `json:"click"`
	Open        Webhook `json:"open"`
}

Webhooks are the set of webhooks supported by a domain.

func Get

func Get(c client.Caller) (*Webhooks, error)

Get retrieves Webhooks for API domain.

Notes

Bugs

Directories

Path Synopsis
Package handler implements types for webhook consumption.
Package handler implements types for webhook consumption.
Package types defines webhook types.
Package types defines webhook types.

Jump to

Keyboard shortcuts

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