webhook

package
v0.0.0-...-b2c82e1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TYPE_MESSAGE webhook type used when a message is received
	TYPE_MESSAGE = "message"
	// TYPE_FACT_RESPONSE webhook type used when an untracked fact response is received
	TYPE_FACT_RESPONSE = "fact_response"
	// TYPE_CONNECTION webhook type used when a connection is received
	TYPE_CONNECTION = "connection"
	// TYPE_REQUEST webhook type used when a request response is received
	TYPE_REQUEST      = "request"
	TYPE_RAW          = "raw"
	TYPE_VOICE_START  = "voice_start"
	TYPE_VOICE_BUSY   = "voice_busy"
	TYPE_VOICE_STOP   = "voice_stop"
	TYPE_VOICE_ACCEPT = "voice_accept"
	TYPE_VOICE_SETUP  = "voice_setup"
	TYPE_SIGNATURE    = "signature"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Poster

type Poster interface {
	Post(url, secret string, p WebhookPayload) error
}

type Webhook

type Webhook struct{}

func NewWebhook

func NewWebhook() *Webhook

func (Webhook) Post

func (w Webhook) Post(url, secret string, p WebhookPayload) error

type WebhookPayload

type WebhookPayload struct {
	// Type is the type of the message.
	Type string `json:"typ"`
	// URI is the URI you can fetch more information about the object on the data field.
	URI string `json:"uri"`
	// Data the object to be sent.
	Data interface{} `json:"data"`
	// Payload the response payload received.
	Payload map[string]interface{} `json:"payload,omitempty"`
}

WebhookPayload represents a the payload that will be resent to the configured webhook URL if provided.

Jump to

Keyboard shortcuts

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