Documentation ¶
Overview ¶
Package bond provides the interface to access Bond API.
Index ¶
- type AddBotsOption
- type Client
- func (c *Client) AddBots(ctx context.Context, meetingCode string, numBots int, ttl time.Duration, ...) ([]int, int, error)
- func (c *Client) AvailableWorkers(ctx context.Context) (int, error)
- func (c *Client) Close()
- func (c *Client) CreateConference(ctx context.Context) (string, error)
- func (c *Client) ExecuteScript(ctx context.Context, script, meetingCode string) error
- func (c *Client) RemoveAllBots(ctx context.Context, meetingCode string) (failedIDs, notFoundIDs []int, err error)
- type NewClientOption
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 ¶
AvailableWorkers returns the number of available workers in the server.
func (*Client) CreateConference ¶
CreateConference creates a new conference and returns its meeting code.
func (*Client) ExecuteScript ¶
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.