bot

package
v0.0.0-...-9fc9297 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Idle       = "Idle"
	Connecting = "Connecting"
	Connected  = "Connected"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ABot

type ABot struct {
	ClosePeerConnectionChan   chan struct{}
	QuitWebRTCChan            chan struct{}
	WebRTCConnectionStateChan chan string
	DescriptionChan           chan webrtc.SessionDescription
	CandidateChan             chan webrtc.ICECandidateInit
	ArenaDescriptionChan      chan webrtc.SessionDescription
	ArenaCandidateChan        chan webrtc.ICECandidateInit
	SendDataChan              chan string
	WSConStatChan             chan string
	ControlsReadyChan         chan bool
	ID                        int
	Status                    string
	IsReady                   bool
	ConnectionID              string
}

func Factory

func Factory(id int) ABot

func (*ABot) ClearConnectionID

func (b *ABot) ClearConnectionID()

func (*ABot) NotifyAreControlsAllowedBySupervisorChange

func (b *ABot) NotifyAreControlsAllowedBySupervisorChange(state bool)

func (*ABot) Run

func (b *ABot) Run(p RunParams)

func (*ABot) SetConnected

func (b *ABot) SetConnected()

func (*ABot) SetConnecting

func (b *ABot) SetConnecting()

func (*ABot) SetIdle

func (b *ABot) SetIdle()

type CreateConnectionAction

type CreateConnectionAction struct {
	Name    string                  `json:"name"`
	Payload CreateConnectionPayload `json:"payload"`
}

type CreateConnectionPayload

type CreateConnectionPayload struct {
	Token     string `json:"token"`
	PublicKey string `json:"publicKey"`
	ID        int    `json:"id"`
}

type RunParams

type RunParams struct {
	StunUrls                          []string
	TokenString                       string
	PublicKey                         string
	Api                               *webrtc.API
	MediaStream                       mediadevices.MediaStream
	WsWriteChan                       chan string
	BotCommandsWriteChan              chan string
	GetAreControlsAllowedBySupervisor func() bool
	GetAreBotsReady                   func() bool
	SetBotReady                       func(int)
	SetBotNotReady                    func(int)
	IsAudioOutputEnabled              bool
	CameraSelectChan                  chan string
}

Jump to

Keyboard shortcuts

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