webhook

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 16 Imported by: 7

Documentation

Index

Constants

View Source
const (
	EventRoomStarted       = "room_started"
	EventRoomFinished      = "room_finished"
	EventParticipantJoined = "participant_joined"
	EventParticipantLeft   = "participant_left"
	EventTrackPublished    = "track_published"
	EventTrackUnpublished  = "track_unpublished"
	EventEgressStarted     = "egress_started"
	EventEgressUpdated     = "egress_updated"
	EventEgressEnded       = "egress_ended"
	EventIngressStarted    = "ingress_started"
	EventIngressEnded      = "ingress_ended"
)

Variables

View Source
var (
	ErrNoAuthHeader    = errors.New("authorization header could not be found")
	ErrSecretNotFound  = errors.New("API secret could not be found")
	ErrInvalidChecksum = errors.New("could not verify authenticity of message")
)

Functions

func Receive

func Receive(r *http.Request, provider auth.KeyProvider) ([]byte, error)

Receive reads and verifies incoming webhook is signed with key/secret pair closes body after reading

func ReceiveWebhookEvent added in v0.13.0

func ReceiveWebhookEvent(r *http.Request, provider auth.KeyProvider) (*livekit.WebhookEvent, error)

ReceiveWebhookEvent reads and verifies incoming webhook, and returns a parsed WebhookEvent

Types

type DefaultNotifier added in v1.5.4

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

func (*DefaultNotifier) QueueNotify added in v1.5.4

func (n *DefaultNotifier) QueueNotify(_ context.Context, event *livekit.WebhookEvent) error

func (*DefaultNotifier) Stop added in v1.5.4

func (n *DefaultNotifier) Stop(force bool)

type QueuedNotifier added in v1.5.4

type QueuedNotifier interface {
	QueueNotify(ctx context.Context, event *livekit.WebhookEvent) error
}

func NewDefaultNotifier added in v1.5.4

func NewDefaultNotifier(apiKey, apiSecret string, urls []string) QueuedNotifier

type URLNotifier added in v1.5.4

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

URLNotifier is a QueuedNotifier that sends a POST request to a Webhook URL. It will retry on failure, and will drop events if notification fall too far behind

func NewURLNotifier added in v1.5.4

func NewURLNotifier(params URLNotifierParams) *URLNotifier

func (*URLNotifier) QueueNotify added in v1.5.4

func (n *URLNotifier) QueueNotify(event *livekit.WebhookEvent) error

func (*URLNotifier) SetKeys added in v1.5.4

func (n *URLNotifier) SetKeys(apiKey, apiSecret string)

func (*URLNotifier) Stop added in v1.5.4

func (n *URLNotifier) Stop(force bool)

type URLNotifierParams added in v1.5.4

type URLNotifierParams struct {
	Logger    logger.Logger
	QueueSize int
	URL       string
	APIKey    string
	APISecret string
}

Jump to

Keyboard shortcuts

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