webhooks

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendChatEvent

func SendChatEvent(chatEvent *events.UserMessageEvent)

SendChatEvent will send a chat event to webhook destinations.

func SendChatEventSetMessageVisibility added in v0.1.0

func SendChatEventSetMessageVisibility(event events.SetMessageVisibilityEvent)

SendChatEventSetMessageVisibility sends a webhook notifying that the visibility of one or more messages has changed.

func SendChatEventUserJoined

func SendChatEventUserJoined(event events.UserJoinedEvent)

SendChatEventUserJoined sends a webhook notifying that a user has joined.

func SendChatEventUserParted added in v0.1.2

func SendChatEventUserParted(event events.UserPartEvent)

SendChatEventUserParted sends a webhook notifying that a user has parted.

func SendChatEventUsernameChanged

func SendChatEventUsernameChanged(event events.NameChangeEvent)

SendChatEventUsernameChanged will send a username changed event to webhook destinations.

func SendEventToWebhooks

func SendEventToWebhooks(payload WebhookEvent)

SendEventToWebhooks will send a single webhook event to all webhook destinations.

func SendStreamStatusEvent

func SendStreamStatusEvent(eventType models.EventType)

SendStreamStatusEvent will send all webhook destinations the current stream status.

func SetupWebhooks added in v0.1.1

func SetupWebhooks(getStatusFunc func() models.Status)

SetupWebhooks initializes the webhook worker pool and sets the function to get the current status.

Types

type Job added in v0.0.11

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

Job struct bundling the webhook and the payload in one struct.

type WebhookChatMessage

type WebhookChatMessage struct {
	User      *models.User `json:"user,omitempty"`
	Timestamp *time.Time   `json:"timestamp,omitempty"`
	Body      string       `json:"body,omitempty"`
	RawBody   string       `json:"rawBody,omitempty"`
	ID        string       `json:"id,omitempty"`
	ClientID  uint         `json:"clientId,omitempty"`
	Visible   bool         `json:"visible"`
}

WebhookChatMessage represents a single chat message sent as a webhook payload.

type WebhookEvent

type WebhookEvent struct {
	EventData interface{}      `json:"eventData,omitempty"`
	Type      models.EventType `json:"type"` // messageSent | userJoined | userNameChange
}

WebhookEvent represents an event sent as a webhook.

Jump to

Keyboard shortcuts

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