pool

package
v0.0.0-...-bb896f4 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BotPool

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

BotPool holds a set of bots uniquely identified by an ID

func NewBotPool

func NewBotPool(controlAPI *api.API, botProvider *providers.BotProvider) (*BotPool, error)

NewBotPool creates a BotPool with default values.

func (*BotPool) AddViaID

func (b *BotPool) AddViaID(id string) error

AddViaID will use a BotConfigProvider to get all the necessary information to create the bot for the given Bot ID. This is an idempotent function

func (*BotPool) GetBotIDs

func (b *BotPool) GetBotIDs() []string

GetBotIDs returns all known BotIDs in no particular order

func (*BotPool) RemoveViaID

func (b *BotPool) RemoveViaID(id string)

RemoveViaID removes a bot via its ID. This is an idempotent function.

func (*BotPool) Run

func (b *BotPool) Run(ctx context.Context) (err error)

Run the BotPool. If a new bot is added to the pool, it will be automatically started.

type GetBotsResponse

type GetBotsResponse struct {
	Bots []string `json:"bots"`
}

GetBotsResponse is the response for bots endpoint

Jump to

Keyboard shortcuts

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