bond

package
v0.0.0-...-9474aff Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package bond provides the interface to access Bond API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddBotsOption

type AddBotsOption func(*addBotsOptions)

AddBotsOption customizes the request of AddBods.

func WithLayout

func WithLayout(layout string) AddBotsOption

WithLayout modifies the layout of the bot.

func WithSendFPS

func WithSendFPS(fps int) AddBotsOption

WithSendFPS can change the frame rate a bot produces.

func WithVP9

func WithVP9(allow, send bool) AddBotsOption

WithVP9 customizes the VP9 capability of the bot.

type Client

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

Client is a client to send Bond API requests.

func NewClient

func NewClient(ctx context.Context, opts ...NewClientOption) (*Client, error)

NewClient creates a new instance of Client.

func (*Client) AddBots

func (c *Client) AddBots(ctx context.Context, meetingCode string, numBots int, ttl time.Duration, opts ...AddBotsOption) ([]int, int, error)

AddBots add a number of bots to the specified conference room with the duration. On success, it also returns the list of bot IDs and the number of bots that failed to join.

func (*Client) AvailableWorkers

func (c *Client) AvailableWorkers(ctx context.Context) (int, error)

AvailableWorkers returns the number of available workers in the server.

func (*Client) Close

func (c *Client) Close()

Close closes the all unused connections.

func (*Client) CreateConference

func (c *Client) CreateConference(ctx context.Context) (string, error)

CreateConference creates a new conference and returns its meeting code.

func (*Client) ExecuteScript

func (c *Client) ExecuteScript(ctx context.Context, script, meetingCode string) error

ExecuteScript requests the server to execute a script.

func (*Client) RemoveAllBots

func (c *Client) RemoveAllBots(ctx context.Context, meetingCode string) (failedIDs, notFoundIDs []int, err error)

RemoveAllBots removes all bots from the specified conference room. On success, it also returns the list of IDs of bots that failed to be removed and the list of IDs of bots that were not found.

type NewClientOption

type NewClientOption func(*newClientOption)

NewClientOption is an option to customize creating a new client.

func WithCredsJSON

func WithCredsJSON(jsonData []byte) NewClientOption

WithCredsJSON specifies the customized json credential rather than the default one.

Jump to

Keyboard shortcuts

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