webhook

package
v0.0.0-...-e1ec090 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TaskCompleteRequest

type TaskCompleteRequest struct {
	Data struct {
		Token string `json:"token"`
	} `json:"data"`
}

TaskCompleteRequest is what's sent to a webhook upon task completion

type TaskErrorRequest

type TaskErrorRequest struct {
	Data struct {
		Token string `json:"token"`
		Error string `json:"error"`
	} `json:"data"`
}

type Webhook

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

Webhook holds methods for posting to webhooks

func CreateService

func CreateService() *Webhook

CreateService creates an instance of the webhook service object

func (Webhook) BuildTaskCompleteRequest

func (w Webhook) BuildTaskCompleteRequest(token string) *bytes.Buffer

BuildTaskCompleteRequest builds a task complete request

func (Webhook) BuildTaskErrorRequest

func (w Webhook) BuildTaskErrorRequest(token string, errorData string) *bytes.Buffer

BuildTaskCompleteRequest builds an task errored request

func (Webhook) Post

func (w Webhook) Post(data *bytes.Buffer)

Post posts to a given url with response data

Jump to

Keyboard shortcuts

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