webhooks

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidEventType added in v1.0.4

func IsValidEventType(e EventType) bool

IsValid checks if the given event type is valid.

e is the event type to be checked. Returns true if the event type is valid, false otherwise.

Types

type EventType

type EventType string
const (
	// Triggered when an SMS is received.
	EventTypeSmsReceived EventType = "sms:received"
	// Triggered when an SMS is sent.
	EventTypeSmsSent EventType = "sms:sent"
	// Triggered when the device pings the server.
	EventTypeSystemPing EventType = "system:ping"
)

type Webhook

type Webhook struct {
	// The unique identifier of the webhook.
	ID string `json:"id" validate:"max=36" example:"123e4567-e89b-12d3-a456-426614174000"`

	// The URL the webhook will be sent to.
	URL string `json:"url" validate:"required,http_url" example:"https://example.com/webhook"`

	// The type of event the webhook is triggered for.
	Event EventType `json:"event" validate:"required" example:"sms:received"`
}

A webhook configuration.

Jump to

Keyboard shortcuts

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