webhook

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// URL is the HTTPS URL to a worker
	URL string

	// Header is the HTTP header used to set the access token
	// Header defaults to X-Access-Token
	Header string

	// Token is an authorization token used to communicate with the worker
	Token string
}

Client implements the dispatch.WorkerClient interface for webhooks.

func (*Client) Submit

func (w *Client) Submit(r event.AuthRequest) (*event.AuthResponse, error)

Submit fulfils the dispatch.WorkerClient interface and submits a task to the configured webhook server.

type Driver

type Driver struct{}

Driver implements the dispatch.WorkerClient interface.

func (Driver) New

func (Driver) New(opts map[string]string) (dispatch.WorkerClient, error)

New is used to create a webhook worker client and accepts the following configuration options:

url:    an HTTPS link to the webhook server.
token:  a shared secret used to authenticate the client to the webhook server.
header: the HTTP header used for authentication (defaults to X-Access-Token).

Jump to

Keyboard shortcuts

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