agent

package
v0.0.0-...-c3558ab Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: ISC Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance struct {
	Tenant             string
	SchedulingStrategy string
	Fqdn               string
	MachineID          string
	Properties         *PropertiesBBB
}

Instance encapsulates information of the node

func NewInstance

func NewInstance(schedulingStrategy, tenant string, properties *PropertiesBBB) (*Instance, error)

NewInstance creates a new instance of Instance

type IntervalAgent

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

IntervalAgent provides base to run agent functionality periodically

func NewIntervalAgent

func NewIntervalAgent(options ...IntervalAgentOption) (*IntervalAgent, error)

NewIntervalAgent instantiates a new IntervalAgent with default configuration. Configuration can be changed with agentOptions

func (IntervalAgent) Run

func (a IntervalAgent) Run(ctx context.Context)

Run starts the periodic execution of the internal routine. This call is blocking due to internal loop, you might want to start it as a goroutine.

type IntervalAgentOption

type IntervalAgentOption func(agent *IntervalAgent)

IntervalAgentOption may be passed to NewIntervalAgent to configure IntervalAgent

func WithInterval

func WithInterval(d time.Duration) IntervalAgentOption

WithInterval returns IntervalAgentOption that sets the regular interval of IntervalAgent to provided duration

func WithLogger

func WithLogger(logger *zap.Logger) IntervalAgentOption

WithLogger returns IntervalAgentOption that sets the internal logger of IntervalAgent

func WithRetryInterval

func WithRetryInterval(s backoff.Strategy) IntervalAgentOption

WithRetryInterval returns IntervalAgentOption that sets the retry interval of IntervalAgent to provided duration. The retry interval is used in case of errors in the routine

func WithStartDelay

func WithStartDelay(d time.Duration) IntervalAgentOption

WithStartDelay returns IntervalAgentOption that sets internal grace period of IntervalAgent to provided duration. The grace period delays the initial execution of the internal routine

type MeetingStats

type MeetingStats struct {
	MeetingID      string `json:"meetingID"`
	BBBMeetingID   string `json:"BBBMeetingID"`
	RoomsMeetingID string `json:"roomsMeetingID"`

	Name             string `json:"name"`
	IsBreakout       bool   `json:"isBreakout"`
	ParticipantCount int    `json:"participantCount"`
	VideoCount       int    `json:"videoCount"`
	AttendeePW       string `json:"attendeePW"`
	ModeratorPW      string `json:"moderatorPW"`
	Creator          string `json:"creator"`

	Origin string `json:"origin"`
}

MeetingStats encapsulates all information of a meeting in BBB that are relevant for BBB@Scale

type MeetingStatsCollector

type MeetingStatsCollector interface {
	GetMeetingStats(ctx context.Context) ([]*MeetingStats, error)
}

MeetingStatsCollector is the interface that defines methods to collect meeting stats from BBB

type PropertiesBBB

type PropertiesBBB struct {
	PropertiesFile string
	// contains filtered or unexported fields
}

PropertiesBBB encapsulates BBB specific information

func NewPropertiesBBB

func NewPropertiesBBB(logger *zap.Logger, propertiesFiles []string) (*PropertiesBBB, error)

NewPropertiesBBB instantiates a new instance of PropertiesBBB

func (*PropertiesBBB) LoadSharedSecret

func (p *PropertiesBBB) LoadSharedSecret() (ss string, updated bool, err error)

LoadSharedSecret reads properties file and extracts secret. returns secret as string and indicator if file has been updated since last read.

func (*PropertiesBBB) Secret

func (p *PropertiesBBB) Secret() ([]byte, error)

Secret wraps the LoadSharedSecret to provide the secret from properties file

type RecordingAgent

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

RecordingAgent is an agent that tracks, uploads and publish recordings.

func NewRecordingAgent

func NewRecordingAgent(logger *zap.Logger, doneNotifier RecordingDoneNotifier, conn *grpc.ClientConn, machineID string, scaleRecordingsSecret string, recordingsBaseDir string) *RecordingAgent

NewRecordingAgent instantiates a new RecordingAgent

func (*RecordingAgent) TrackRecordings

func (a *RecordingAgent) TrackRecordings(ctx context.Context) (err error)

TrackRecordings starts the main functionality of the RegistrationAgent.

type RecordingDoneNotifier

type RecordingDoneNotifier interface {
	NotifyRecordingDone(ctx context.Context, recording, meetingID, playbackURL, token string) (err error)
	NotifyRecordingDoneWithMetadataHack(ctx context.Context, recording, meetingID, playbackURL, token string, mdBytes []byte) (err error)
}

RecordingDoneNotifier is the interface that defines methods to notify BBB@Scale regarding finished recordings

type Registerer

type Registerer interface {
	Register(ctx context.Context, instance Instance) (time.Duration, error)
}

Registerer registers information of the instance

type RegistrationAgent

type RegistrationAgent struct {
	*IntervalAgent
	// contains filtered or unexported fields
}

RegistrationAgent is an agent that registers the server to BBB@Scale

func NewRegistrationAgent

func NewRegistrationAgent(i Instance, r Registerer, options ...IntervalAgentOption) (*RegistrationAgent, error)

NewRegistrationAgent instantiates a new RegistrationAgent

type Secreter

type Secreter interface {
	Secret() ([]byte, error)
}

Secreter is an interface that provides a secret

type ServerStats

type ServerStats struct {
	MeetingStats []*MeetingStats `json:"meetings"`
	DNS          string          `json:"dns"`
}

ServerStats encapsulates all MeetingStats of the BBB server and necessary information of the server.

type ServerStatsExporter

type ServerStatsExporter interface {
	SyncServerStats(ctx context.Context, stats ServerStats) (time.Duration, error)
}

ServerStatsExporter is the interface that defines methods to sync server stats with BBB@Scale

type StaticSecret

type StaticSecret string

StaticSecret wrap string type to implement the Secreter interface

func (StaticSecret) Secret

func (s StaticSecret) Secret() ([]byte, error)

Secret provides the secret

type StatsAgent

type StatsAgent struct {
	*IntervalAgent
	// contains filtered or unexported fields
}

StatsAgent is an agent that periodically collects MeetingStats from BBB to publish them to BBB@Scale

func NewStatsAgent

func NewStatsAgent(collector MeetingStatsCollector, exporter ServerStatsExporter, dns string, options ...IntervalAgentOption) (*StatsAgent, error)

NewStatsAgent instantiates a new StatsAgent

Notes

Bugs

  • queue for retry!

  • again, queue for retry!

Jump to

Keyboard shortcuts

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