callbacks

package
v1.2.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RetryCount   = 5
	RetryWaitMin = 1 * time.Second
	RetryWaitMax = 30 * time.Second

	RequestTimeout = 10 * time.Second
)

Configuration

Variables

This section is empty.

Functions

func Dispatch

func Dispatch(req *Request)

Dispatch creates a new http client instance and makes a request to the callback URL.

Each dispatch will spawn a new goroutine. This is a naive implementation and might need to be moved to a worker pool.

Types

type Callback

type Callback interface {
	Validate() error
	Encode() string
}

Callback interface provides a Validate and an Encode method.

type Request

type Request struct {
	URL      string
	Method   string
	Callback Callback
}

Request describes a callback invocation.

func Get added in v1.2.0

func Get(url string) *Request

Get creates a new GET request with a callback URL.

func Post added in v1.2.0

func Post(url string, cb Callback) *Request

Post creates a new POST request.

type SignedBody added in v1.2.0

type SignedBody struct {
	SignedParameters string `json:"signed_parameters" form:"signed_parameters"`
}

SignedBody contains signed parameters posted by the bbb node agent to the callback URL.

The signed_parameters attribute is a JWT.

func (*SignedBody) Encode added in v1.2.0

func (b *SignedBody) Encode() string

Encode encodes the callback request as Form-Encoded data.

func (*SignedBody) Validate added in v1.2.0

func (b *SignedBody) Validate() error

Validate checks an OnRecordingReady request

Jump to

Keyboard shortcuts

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