bbb

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: AGPL-3.0 Imports: 20 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ResourceIndex                  = ""
	ResourceJoin                   = "join"
	ResourceCreate                 = "create"
	ResourceEnd                    = "end"
	ResourceIsMeetingRunning       = "isMeetingRunning"
	ResourceGetMeetingInfo         = "getMeetingInfo"
	ResourceGetMeetings            = "getMeetings"
	ResourceUpdateRecordings       = "updateRecordings"
	ResourceGetDefaultConfigXML    = "getDefaultConfigXML"
	ResourceSetConfigXML           = "setConfigXML"
	ResourceGetRecordings          = "getRecordings"
	ResourceGetRecordingTextTracks = "getRecordingTextTracks"
	ResourcePutRecordingTextTrack  = "putRecordingTextTrack"
	ResourceDeleteRecordings       = "deleteRecordings"
	ResourcePublishRecordings      = "publishRecordings"
)

ApiResources

View Source
const (
	ParamMeetingID = "meetingID"
	ParamChecksum  = "checksum"
	ParamRecordID  = "recordID"
	ParamPublish   = "publish"
	ParamState     = "state"

	ParamDisabledFeatures = "disabledFeatures"
)

Well known params

View Source
const (
	// RetSuccess is the success return code
	RetSuccess = "SUCCESS"

	// RetFailed is the failure return code
	RetFailed = "FAILED"
)
View Source
const (
	// StatePublished is the state of recording, when published
	StatePublished = "published"

	// StateUnpublished is the state of an unpublished recording
	StateUnpublished = "unpublished"

	// StateAny indicates that a recording may be in any state.
	// This is intended for querying.
	StateAny = "any"
)

Variables

View Source
var (
	// ErrCantBeMerged is the error when two responses
	// of the same type can not be merged, e.g. when
	// the data is not a collection.
	ErrCantBeMerged = errors.New(
		"responses of this type can not be merged")

	// ErrMergeConflict will be returned when two
	// responses differ in fields, where they should not.
	// Eg. a successful and a failed return code
	ErrMergeConflict = errors.New(
		"responses have conflicting values")
)
View Source
var (
	// ReQueryChecksum is used for removing the checksum
	// from a querystring in the incoming HTTP request
	ReQueryChecksum = regexp.MustCompile("&checksum(=[^&]*)?|^checksum(=[^&]*)?&?")
)

Functions

func MetaParam

func MetaParam(name string) string

MetaParam creates a meta parameter. In practice this is prefixing `meta_`.

Types

type API

type API interface {
	Join(*Request) (*JoinResponse, error)
	Create(*Request) (*CreateResponse, error)
	IsMeetingRunning(*Request) (*IsMeetingRunningResponse, error)
	End(*Request) (*EndResponse, error)
	GetMeetingInfo(*Request) (*GetMeetingInfoResponse, error)
	GetMeetings(*Request) (*GetMeetingsResponse, error)
	GetRecordings(*Request) (*GetRecordingsResponse, error)
	PublishRecordings(*Request) (*PublishRecordingsResponse, error)
	DeleteRecordings(*Request) (*DeleteRecordingsResponse, error)
	UpdateRecordings(*Request) (*UpdateRecordingsResponse, error)
	GetDefaultConfigXML(*Request) (*GetDefaultConfigXMLResponse, error)
	SetConfigXML(*Request) (*SetConfigXMLResponse, error)
	GetRecordingTextTracks(*Request) (*GetRecordingTextTracksResponse, error)
	PutRecordingTextTrack(*Request) (*PutRecordingTextTrackResponse, error)
}

API is the bbb api interface

type Attendee

type Attendee struct {
	XMLName         xml.Name `xml:"attendee" json:"-"`
	UserID          string   `xml:"userID"`
	InternalUserID  string   `xml:"internalUserID,omit"`
	FullName        string   `xml:"fullName"`
	Role            string   `xml:"role"`
	IsPresenter     bool     `xml:"isPresenter"`
	IsListeningOnly bool     `xml:"isListeningOnly"`
	HasJoinedVoice  bool     `xml:"hasJoinedVoice"`
	HasVideo        bool     `xml:"hasVideo"`
	ClientType      string   `xml:"clientType"`
}

Attendee of a meeting

type Backend

type Backend struct {
	Host   string `` /* 136-byte string literal not displayed */
	Secret string `json:"secret" doc:"The API secret for the BBB host."`
}

The Backend is a bbb backend a request can be directed to like Client.Do(Backend, Req).

type Breakout

type Breakout struct {
	XMLName         xml.Name `xml:"breakout" json:"-"`
	ParentMeetingID string   `xml:"parentMeetingID"`
	Sequence        int      `xml:"sequence"`
	FreeJoin        bool     `xml:"freeJoin"`
}

Breakout info

type BreakoutInfo

type BreakoutInfo struct {
	Name       string
	ExternalID string
	BreakoutID string
	Sequence   int
	FreeJoin   bool
}

BreakoutInfo contains breakout room information

type BreakoutRoomStartedEvent

type BreakoutRoomStartedEvent struct {
	ParentInternalMeetingID string
	Breakout                *BreakoutInfo
}

BreakoutRoomStartedEvent indicates the start of a breakout room

type Client

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

A Client for communicating with a big blue button instance. Requests are signed and encoded. Responses are decoded.

func NewClient

func NewClient() *Client

NewClient creates and configures a new http client and creates the big blue client object.

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *Request) (Response, error)

Do sends the request to the backend. The request is signed. The response is decoded into a BBB response.

type CreateResponse

type CreateResponse struct {
	*XMLResponse
	*Meeting
}

CreateResponse is the resonse for the `create` API resource.

func UnmarshalCreateResponse

func UnmarshalCreateResponse(data []byte) (*CreateResponse, error)

UnmarshalCreateResponse decodes the resonse XML data.

func (*CreateResponse) Header

func (res *CreateResponse) Header() http.Header

Header returns the HTTP response headers

func (*CreateResponse) Marshal

func (res *CreateResponse) Marshal() ([]byte, error)

Marshal a CreateResponse to XML

func (*CreateResponse) Merge

func (res *CreateResponse) Merge(other Response) error

Merge another response

func (*CreateResponse) SetHeader

func (res *CreateResponse) SetHeader(h http.Header)

SetHeader sets the HTTP response headers

func (*CreateResponse) SetStatus

func (res *CreateResponse) SetStatus(s int)

SetStatus sets the HTTP response status code

func (*CreateResponse) Status

func (res *CreateResponse) Status() int

Status returns the HTTP response status code

type DeleteRecordingsResponse

type DeleteRecordingsResponse struct {
	*XMLResponse
	Deleted bool `xml:"deleted"`
}

DeleteRecordingsResponse indicates if the recording was correctly deleted. Might fail successfully. Same crap as with the publish resource

func UnmarshalDeleteRecordingsResponse

func UnmarshalDeleteRecordingsResponse(
	data []byte,
) (*DeleteRecordingsResponse, error)

UnmarshalDeleteRecordingsResponse decodes XML resource response

func (*DeleteRecordingsResponse) Header

func (res *DeleteRecordingsResponse) Header() http.Header

Header returns the HTTP response headers

func (*DeleteRecordingsResponse) Marshal

func (res *DeleteRecordingsResponse) Marshal() ([]byte, error)

Marshal encodes the delete recordings response as XML

func (*DeleteRecordingsResponse) Merge

func (res *DeleteRecordingsResponse) Merge(other Response) error

Merge a DeleteRecordingsResponse

func (*DeleteRecordingsResponse) SetHeader

func (res *DeleteRecordingsResponse) SetHeader(h http.Header)

SetHeader sets the HTTP response headers

func (*DeleteRecordingsResponse) SetStatus

func (res *DeleteRecordingsResponse) SetStatus(s int)

SetStatus sets the HTTP response status code

func (*DeleteRecordingsResponse) Status

func (res *DeleteRecordingsResponse) Status() int

Status returns the HTTP response status code

type EndResponse

type EndResponse struct {
	*XMLResponse
}

EndResponse is the resonse of the end resource

func UnmarshalEndResponse

func UnmarshalEndResponse(data []byte) (*EndResponse, error)

UnmarshalEndResponse decodes the xml resonse

func (*EndResponse) Header

func (res *EndResponse) Header() http.Header

Header returns the HTTP response headers

func (*EndResponse) Marshal

func (res *EndResponse) Marshal() ([]byte, error)

Marshal EndResponse to XML

func (*EndResponse) Merge

func (res *EndResponse) Merge(other Response) error

Merge EndResponses

func (*EndResponse) SetHeader

func (res *EndResponse) SetHeader(h http.Header)

SetHeader sets the HTTP response headers

func (*EndResponse) SetStatus

func (res *EndResponse) SetStatus(s int)

SetStatus sets the HTTP response status code

func (*EndResponse) Status

func (res *EndResponse) Status() int

Status returns the HTTP response status code

type Event

type Event interface{}

An Event is an interface for BBB events. All events (that we care about) have a type and belong to a meeting.

type Format

type Format struct {
	XMLName        xml.Name `xml:"format"`
	Type           string   `xml:"type"`
	URL            string   `xml:"url"`
	ProcessingTime int      `xml:"processingTime"` // No idea. The example is 7177.
	Length         int      `xml:"length"`
	Preview        *Preview `xml:"preview"`
}

Format contains a link to the playable media

type Frontend

type Frontend struct {
	Key    string `json:"key" doc:"The tenant is identified by the key, which is part of frontend specific API url." example:"greenlight01"`
	Secret string `` /* 142-byte string literal not displayed */
}

The Frontend is a source for requests

type GetDefaultConfigXMLResponse

type GetDefaultConfigXMLResponse struct {
	Config []byte
	// contains filtered or unexported fields
}

GetDefaultConfigXMLResponse has the raw config xml data

func UnmarshalGetDefaultConfigXMLResponse

func UnmarshalGetDefaultConfigXMLResponse(
	data []byte,
) (*GetDefaultConfigXMLResponse, error)

UnmarshalGetDefaultConfigXMLResponse creates a new response from the data.

func (*GetDefaultConfigXMLResponse) Header

func (res *GetDefaultConfigXMLResponse) Header() http.Header

Header returns the HTTP response headers

func (*GetDefaultConfigXMLResponse) IsSuccess

func (res *GetDefaultConfigXMLResponse) IsSuccess() bool

IsSuccess checks if the returncode of the response is 'SUCCESS'.

func (*GetDefaultConfigXMLResponse) Marshal

func (res *GetDefaultConfigXMLResponse) Marshal() ([]byte, error)

Marshal GetDefaultConfigXMLResponse encodes the response body which is just the data.

func (*GetDefaultConfigXMLResponse) Merge

func (res *GetDefaultConfigXMLResponse) Merge(other Response) error

Merge GetDefaultConfigXMLResponse

func (*GetDefaultConfigXMLResponse) SetHeader

func (res *GetDefaultConfigXMLResponse) SetHeader(h http.Header)

SetHeader sets the HTTP response headers

func (*GetDefaultConfigXMLResponse) SetStatus

func (res *GetDefaultConfigXMLResponse) SetStatus(s int)

SetStatus sets the HTTP response status code

func (*GetDefaultConfigXMLResponse) Status

func (res *GetDefaultConfigXMLResponse) Status() int

Status returns the HTTP response status code

type GetMeetingInfoResponse

type GetMeetingInfoResponse struct {
	*XMLResponse
	*Meeting
}

GetMeetingInfoResponse contains detailed meeting information

func UnmarshalGetMeetingInfoResponse

func UnmarshalGetMeetingInfoResponse(
	data []byte,
) (*GetMeetingInfoResponse, error)

UnmarshalGetMeetingInfoResponse decodes the xml response

func (*GetMeetingInfoResponse) Header

func (res *GetMeetingInfoResponse) Header() http.Header

Header returns the HTTP response headers

func (*GetMeetingInfoResponse) Marshal

func (res *GetMeetingInfoResponse) Marshal() ([]byte, error)

Marshal GetMeetingInfoResponse to XML

func (*GetMeetingInfoResponse) Merge

func (res *GetMeetingInfoResponse) Merge(other Response) error

Merge GetMeetingInfoResponse

func (*GetMeetingInfoResponse) SetHeader

func (res *GetMeetingInfoResponse) SetHeader(h http.Header)

SetHeader sets the HTTP response headers

func (*GetMeetingInfoResponse) SetStatus

func (res *GetMeetingInfoResponse) SetStatus(s int)

SetStatus sets the HTTP response status code

func (*GetMeetingInfoResponse) Status

func (res *GetMeetingInfoResponse) Status() int

Status returns the HTTP response status code

type GetMeetingsResponse

type GetMeetingsResponse struct {
	*XMLResponse
	Meetings []*Meeting `xml:"meetings>meeting"`
}

GetMeetingsResponse contains a list of meetings.

func UnmarshalGetMeetingsResponse

func UnmarshalGetMeetingsResponse(
	data []byte,
) (*GetMeetingsResponse, error)

UnmarshalGetMeetingsResponse decodes the xml response

func (*GetMeetingsResponse) Header

func (res *GetMeetingsResponse) Header() http.Header

Header returns the HTTP response headers

func (*GetMeetingsResponse) Marshal

func (res *GetMeetingsResponse) Marshal() ([]byte, error)

Marshal serializes the response as XML

func (*GetMeetingsResponse) Merge

func (res *GetMeetingsResponse) Merge(other Response) error

Merge get meetings responses

func (*GetMeetingsResponse) SetHeader

func (res *GetMeetingsResponse) SetHeader(h http.Header)

SetHeader sets the HTTP response headers

func (*GetMeetingsResponse) SetStatus

func (res *GetMeetingsResponse) SetStatus(s int)

SetStatus sets the HTTP response status code

func (*GetMeetingsResponse) Status

func (res *GetMeetingsResponse) Status() int

Status returns the HTTP response status code

type GetRecordingTextTracksResponse

type GetRecordingTextTracksResponse struct {
	Returncode string       `json:"returncode"`
	MessageKey string       `json:"messageKey,omitempty"`
	Message    string       `json:"message,omitempty"`
	Tracks     []*TextTrack `json:"tracks"`
	// contains filtered or unexported fields
}

GetRecordingTextTracksResponse lists all tracks

func UnmarshalGetRecordingTextTracksResponse

func UnmarshalGetRecordingTextTracksResponse(
	data []byte,
) (*GetRecordingTextTracksResponse, error)

UnmarshalGetRecordingTextTracksResponse decodes the json

func (*GetRecordingTextTracksResponse) Header

Header returns the HTTP response headers

func (*GetRecordingTextTracksResponse) IsSuccess

func (res *GetRecordingTextTracksResponse) IsSuccess() bool

IsSuccess checks if the returncode of the response is 'SUCCESS'.

func (*GetRecordingTextTracksResponse) Marshal

func (res *GetRecordingTextTracksResponse) Marshal() ([]byte, error)

Marshal GetRecordingTextTracksResponse to JSON

func (*GetRecordingTextTracksResponse) Merge

func (res *GetRecordingTextTracksResponse) Merge(other Response) error

Merge GetRecordingTextTracksResponse

func (*GetRecordingTextTracksResponse) SetHeader

func (res *GetRecordingTextTracksResponse) SetHeader(h http.Header)

SetHeader sets the HTTP response header

func (*GetRecordingTextTracksResponse) SetStatus

func (res *GetRecordingTextTracksResponse) SetStatus(s int)

SetStatus sets the HTTP response status code

func (*GetRecordingTextTracksResponse) Status

func (res *GetRecordingTextTracksResponse) Status() int

Status returns the HTTP response status code

type GetRecordingsResponse

type GetRecordingsResponse struct {
	*XMLResponse
	Recordings []*Recording `xml:"recordings>recording"`
}

GetRecordingsResponse is the response of the getRecordings resource

func UnmarshalGetRecordingsResponse

func UnmarshalGetRecordingsResponse(
	data []byte,
) (*GetRecordingsResponse, error)

UnmarshalGetRecordingsResponse deserializes the response XML

func (*GetRecordingsResponse) Header

func (res *GetRecordingsResponse) Header() http.Header

Header returns the HTTP response headers

func (*GetRecordingsResponse) Marshal

func (res *GetRecordingsResponse) Marshal() ([]byte, error)

Marshal a GetRecordingsResponse to XML

func (*GetRecordingsResponse) Merge

func (res *GetRecordingsResponse) Merge(other Response) error

Merge another GetRecordingsResponse

func (*GetRecordingsResponse) SetHeader

func (res *GetRecordingsResponse) SetHeader(h http.Header)

SetHeader sets the HTTP response headers

func (*GetRecordingsResponse) SetStatus

func (res *GetRecordingsResponse) SetStatus(s int)

SetStatus sets the HTTP response status code

func (*GetRecordingsResponse) Status

func (res *GetRecordingsResponse) Status() int

Status returns the HTTP response status code

type Image

type Image struct {
	XMLName xml.Name `xml:"image"`
	Alt     string   `xml:"alt,attr,omitempty"`
	Height  int      `xml:"height,attr,omitempty"`
	Width   int      `xml:"width,attr,omitempty"`
	URL     string   `xml:",chardata"`
}

Image is a preview image of the format

type Images

type Images struct {
	XMLName xml.Name `xml:"images"`
	All     []*Image `xml:"image"`
}

Images is a collection of Image

type IsMeetingRunningResponse

type IsMeetingRunningResponse struct {
	*XMLResponse
	Running bool `xml:"running"`
}

IsMeetingRunningResponse is a meeting status resonse

func UnmarshalIsMeetingRunningResponse

func UnmarshalIsMeetingRunningResponse(
	data []byte,
) (*IsMeetingRunningResponse, error)

UnmarshalIsMeetingRunningResponse decodes the XML data.

func (*IsMeetingRunningResponse) Header

func (res *IsMeetingRunningResponse) Header() http.Header

Header returns the HTTP response headers

func (*IsMeetingRunningResponse) Marshal

func (res *IsMeetingRunningResponse) Marshal() ([]byte, error)

Marshal a IsMeetingRunningResponse to XML

func (*IsMeetingRunningResponse) Merge

func (res *IsMeetingRunningResponse) Merge(other Response) error

Merge IsMeetingRunning responses

func (*IsMeetingRunningResponse) SetHeader

func (res *IsMeetingRunningResponse) SetHeader(h http.Header)

SetHeader sets the HTTP response headers

func (*IsMeetingRunningResponse) SetStatus

func (res *IsMeetingRunningResponse) SetStatus(s int)

SetStatus sets the HTTP response status code

func (*IsMeetingRunningResponse) Status

func (res *IsMeetingRunningResponse) Status() int

Status returns the HTTP response status code

type JSONResponse

type JSONResponse struct {
	Response interface{} `json:"response"`
}

JSONResponse encapsulates a json reponse

type JoinResponse

type JoinResponse struct {
	*XMLResponse
	MeetingID    string `xml:"meeting_id"`
	UserID       string `xml:"user_id"`
	AuthToken    string `xml:"auth_token"`
	SessionToken string `xml:"session_token"`
	URL          string `xml:"url"`
	// contains filtered or unexported fields
}

JoinResponse of the join resource. WARNING: the join response might be a html page without any meaningful data.

func UnmarshalJoinResponse

func UnmarshalJoinResponse(data []byte) (*JoinResponse, error)

UnmarshalJoinResponse decodes the serialized XML data

func (*JoinResponse) Header

func (res *JoinResponse) Header() http.Header

Header returns the HTTP response headers

func (*JoinResponse) IsRaw

func (res *JoinResponse) IsRaw() bool

IsRaw returns true if the response could not be decoded from XML data

func (*JoinResponse) Marshal

func (res *JoinResponse) Marshal() ([]byte, error)

Marshal encodes a JoinResponse as XML

func (*JoinResponse) Merge

func (res *JoinResponse) Merge(other Response) error

Merge another response

func (*JoinResponse) SetHeader

func (res *JoinResponse) SetHeader(h http.Header)

SetHeader sets the HTTP response headers

func (*JoinResponse) SetRaw

func (res *JoinResponse) SetRaw(data []byte)

SetRaw will set a raw content

func (*JoinResponse) SetStatus

func (res *JoinResponse) SetStatus(s int)

SetStatus sets the HTTP response status code

func (*JoinResponse) Status

func (res *JoinResponse) Status() int

Status returns the HTTP response status code

type Meeting

type Meeting struct {
	XMLName               xml.Name  `xml:"meeting" json:"-"`
	MeetingName           string    `xml:"meetingName"`
	MeetingID             string    `xml:"meetingID"`
	InternalMeetingID     string    `xml:"internalMeetingID"`
	CreateTime            Timestamp `xml:"createTime"`
	CreateDate            string    `xml:"createDate"`
	VoiceBridge           string    `xml:"voiceBridge"`
	DialNumber            string    `xml:"dialNumber"`
	AttendeePW            string    `xml:"attendeePW"`
	ModeratorPW           string    `xml:"moderatorPW"`
	Running               bool      `xml:"running"`
	Duration              int       `xml:"duration"`
	Recording             bool      `xml:"recording"`
	HasBeenForciblyEnded  bool      `xml:"hasBeenForciblyEnded"`
	StartTime             Timestamp `xml:"startTime"`
	EndTime               Timestamp `xml:"endTime"`
	ParticipantCount      int       `xml:"participantCount"`
	ListenerCount         int       `xml:"listenerCount"`
	VoiceParticipantCount int       `xml:"voiceParticipantCount"`
	VideoCount            int       `xml:"videoCount"`
	MaxUsers              int       `xml:"maxUsers"`
	ModeratorCount        int       `xml:"moderatorCount"`
	IsBreakout            bool      `xml:"isBreakout"`

	Metadata Metadata `xml:"metadata"`

	Attendees     []*Attendee `xml:"attendees>attendee"`
	BreakoutRooms []string    `xml:"breakoutRooms>breakout"`
	Breakout      *Breakout   `xml:"breakout"`
}

Meeting information

func (*Meeting) String

func (m *Meeting) String() string

func (*Meeting) Update

func (m *Meeting) Update(update *Meeting) error

Update the meeting info with new data

type MeetingCreatedEvent

type MeetingCreatedEvent struct {
	MeetingID         string
	InternalMeetingID string
}

MeetingCreatedEvent indicates the start of a meeting

type MeetingDestroyedEvent

type MeetingDestroyedEvent struct {
	InternalMeetingID string
}

MeetingDestroyedEvent indicates a meeting destroyed

type MeetingEndedEvent

type MeetingEndedEvent struct {
	InternalMeetingID string
}

MeetingEndedEvent indicates the end of a meeting

type Metadata

type Metadata map[string]string

Metadata about the BBB instance, this is not exactly specified in the docs, so we are using a map with string keys and an empty interface for the values.

func (Metadata) MarshalXML

func (meta Metadata) MarshalXML(
	e *xml.Encoder,
	start xml.StartElement,
) error

MarshalXML encodes Metadata as XML

func (*Metadata) UnmarshalXML

func (meta *Metadata) UnmarshalXML(
	d *xml.Decoder, start xml.StartElement,
) error

UnmarshalXML decodes an unordered key, value mapping from XML.

func (Metadata) Update

func (meta Metadata) Update(m Metadata)

Update will replace given metadata with new values. If the value is empty, the key will be unset.

type Params

type Params map[string]string

Params for the BBB API (we opt for stringly typed.)

func (Params) Checksum

func (p Params) Checksum() (string, bool)

Checksum retrievs the well known checksum param

func (Params) MarshalJSON

func (p Params) MarshalJSON() ([]byte, error)

MarshalJSON is a custom implementation of the interface to omit empty values.

func (Params) MeetingID

func (p Params) MeetingID() (string, bool)

MeetingID retrievs the well known meeting id value from the set of params.

func (Params) MeetingIDs

func (p Params) MeetingIDs() ([]string, bool)

MeetingIDs interprets the MeetingsID parameter as a comma separated set of meeting ids.

func (Params) Publish

func (p Params) Publish() (bool, bool)

Publish retrieves the well known recording publish parameter

func (Params) RecordID

func (p Params) RecordID() (string, bool)

RecordID retrievs a single recordID

func (Params) RecordIDs

func (p Params) RecordIDs() ([]string, bool)

RecordIDs retrieves the well known recordID param It is always a list interally

func (Params) States

func (p Params) States() ([]string, bool)

States retrievs a set of states from the `state` param. The parameter state can be used to filter results. It can be a set of states separate by commas.

func (Params) String

func (p Params) String() string

String of the query parameters. The order of the parameters is made deterministic.

func (Params) ToMetadata

func (p Params) ToMetadata() Metadata

ToMetadata converts meta_ params into Metadata

type Preview

type Preview struct {
	XMLName xml.Name `xml:"preview"`
	Images  *Images  `xml:"images"`
}

Preview contains a list of images

type PublishRecordingsResponse

type PublishRecordingsResponse struct {
	*XMLResponse
	Published bool `xml:"published"`
}

PublishRecordingsResponse indicates if the recordings were published. This also has the potential for tasks failed successfully. Also the endpoint is designed badly because you can send a set of recordings and receive just a single published true or false.

func UnmarshalPublishRecordingsResponse

func UnmarshalPublishRecordingsResponse(
	data []byte,
) (*PublishRecordingsResponse, error)

UnmarshalPublishRecordingsResponse decodes the XML response

func (*PublishRecordingsResponse) Header

func (res *PublishRecordingsResponse) Header() http.Header

Header returns the HTTP response headers

func (*PublishRecordingsResponse) Marshal

func (res *PublishRecordingsResponse) Marshal() ([]byte, error)

Marshal a publishRecodingsResponse to XML

func (*PublishRecordingsResponse) Merge

func (res *PublishRecordingsResponse) Merge(other Response) error

Merge a PublishRecordingsResponse

func (*PublishRecordingsResponse) SetHeader

func (res *PublishRecordingsResponse) SetHeader(h http.Header)

SetHeader sets the HTTP response headers

func (*PublishRecordingsResponse) SetStatus

func (res *PublishRecordingsResponse) SetStatus(s int)

SetStatus sets the HTTP response status code

func (*PublishRecordingsResponse) Status

func (res *PublishRecordingsResponse) Status() int

Status returns the HTTP response status code

type PutRecordingTextTrackResponse

type PutRecordingTextTrackResponse struct {
	Returncode string `json:"returncode"`
	MessageKey string `json:"messageKey,omitempty"`
	Message    string `json:"message,omitempty"`
	RecordID   string `json:"recordId,omitempty"`
	// contains filtered or unexported fields
}

PutRecordingTextTrackResponse is the response when uploading a text track. Response is in JSON.

func UnmarshalPutRecordingTextTrackResponse

func UnmarshalPutRecordingTextTrackResponse(
	data []byte,
) (*PutRecordingTextTrackResponse, error)

UnmarshalPutRecordingTextTrackResponse decodes the json response

func (*PutRecordingTextTrackResponse) Header

Header returns the HTTP response headers

func (*PutRecordingTextTrackResponse) IsSuccess

func (res *PutRecordingTextTrackResponse) IsSuccess() bool

IsSuccess checks if the returncode of the response is 'SUCCESS'.

func (*PutRecordingTextTrackResponse) Marshal

func (res *PutRecordingTextTrackResponse) Marshal() ([]byte, error)

Marshal a PutRecordingTextTrackResponse to JSON

func (*PutRecordingTextTrackResponse) Merge

func (res *PutRecordingTextTrackResponse) Merge(other Response) error

Merge a put recording text track

func (*PutRecordingTextTrackResponse) SetHeader

func (res *PutRecordingTextTrackResponse) SetHeader(h http.Header)

SetHeader sets the HTTP response header

func (*PutRecordingTextTrackResponse) SetStatus

func (res *PutRecordingTextTrackResponse) SetStatus(s int)

SetStatus sets the HTTP response status code

func (*PutRecordingTextTrackResponse) Status

func (res *PutRecordingTextTrackResponse) Status() int

Status returns the HTTP response status code

type Recording

type Recording struct {
	XMLName           xml.Name  `xml:"recording"`
	RecordID          string    `xml:"recordID"`
	MeetingID         string    `xml:"meetingID"`
	InternalMeetingID string    `xml:"internalMeetingID"`
	Name              string    `xml:"name"`
	IsBreakout        bool      `xml:"isBreakout"`
	Published         bool      `xml:"published"`
	State             string    `xml:"state"`
	StartTime         Timestamp `xml:"startTime"`
	EndTime           Timestamp `xml:"endTime"`
	Participants      int       `xml:"participants"`
	Metadata          Metadata  `xml:"metadata"`
	Formats           []*Format `xml:"playback>format"`
}

Recording is a recorded bbb session

func (*Recording) SetPlaybackHost

func (r *Recording) SetPlaybackHost(host string)

SetPlaybackHost will update the link to the presentation and preview thumbnails

type RecordingMetadata

type RecordingMetadata struct {
	XMLName      xml.Name                   `xml:"recording"`
	RecordID     string                     `xml:"id"`
	State        string                     `xml:"state"`
	Published    bool                       `xml:"published"`
	StartTime    Timestamp                  `xml:"start_time"`
	EndTime      Timestamp                  `xml:"end_time"`
	Participants int                        `xml:"participants"`
	Meeting      *RecordingMetadataMeeting  `xml:"meeting"`
	Meta         Metadata                   `xml:"meta"`
	Playback     *RecordingMetadataPlayback `xml:"playback"`
	RawSize      int                        `xml:"raw_size"`
}

RecordingMetadata can be parsed from a metadata.xml

func UnmarshalRecordingMetadata

func UnmarshalRecordingMetadata(
	data []byte,
) (*RecordingMetadata, error)

UnmarshalRecordingMetadata deserializes bytes

func (*RecordingMetadata) ToRecording

func (m *RecordingMetadata) ToRecording() *Recording

ToRecording converts a recording metadata into a recording

type RecordingMetadataMeeting

type RecordingMetadataMeeting struct {
	InternalMeetingID string `xml:"id,attr"`
	MeetingID         string `xml:"externalId,attr"`
	Name              string `xml:"name,attr"`
	Breakout          bool   `xml:"breakout,attr"`
}

RecordingMetadataMeeting encodes the meeting information from the recordings metadata.xml

type RecordingMetadataPlayback

type RecordingMetadataPlayback struct {
	XMLName        xml.Name `xml:"playback"`
	Format         string   `xml:"format"`
	Link           string   `xml:"link"`
	ProcessingTime int      `xml:"processing_time"`
	Duration       int      `xml:"duration"`
	Size           int      `xml:"size"`
}

RecordingMetadataPlayback contains the playback format

type Request

type Request struct {
	*http.Request

	Resource string
	Params   Params
	Body     []byte
	Checksum string

	Backend  *Backend
	Frontend *Frontend
}

Request is a bbb request as decoded from the incoming url - but can be directly passed on to a BigBlueButton server.

It is associated with a backend and a frontend.

func CreateRequest

func CreateRequest(params Params, body []byte) *Request

CreateRequest creates a new create request

func DeleteRecordingRequest

func DeleteRecordingRequest(recordID string, params Params) *Request

DeleteRecordingRequest creates a request for deleting a single recording. CAVEAT: Updates the params's recordID.

func DeleteRecordingsRequest

func DeleteRecordingsRequest(params Params) *Request

DeleteRecordingsRequest creates a request deleting recordings from a backend.

func EndRequest

func EndRequest(params Params) *Request

EndRequest creates a meeting end request

func GetMeetingInfoRequest

func GetMeetingInfoRequest(params Params) *Request

GetMeetingInfoRequest creates a new getMeetingInfo request

func GetMeetingsRequest

func GetMeetingsRequest(params Params) *Request

GetMeetingsRequest builds a new getMeetings request

func GetRecordingTextTracksRequest

func GetRecordingTextTracksRequest(params Params) *Request

GetRecordingTextTracksRequest creates a new getRecordingTextTracks request

func GetRecordingsRequest

func GetRecordingsRequest(params Params) *Request

GetRecordingsRequest creates a new getRecordings request

func IsMeetingRunningRequest

func IsMeetingRunningRequest(params Params) *Request

IsMeetingRunningRequest makes a new isMeetingRunning request

func JoinRequest

func JoinRequest(params Params) *Request

JoinRequest creates a new join request

func PublishRecordingRequest

func PublishRecordingRequest(recordID string, params Params) *Request

PublishRecordingRequest creates a single publish request for a recording. CAVEAT: Mutates the parameters by asserting the recordID is set to the given recordID.

func PublishRecordingsRequest

func PublishRecordingsRequest(params Params) *Request

PublishRecordingsRequest creates a new request for publishing recordings on a backend.

func UnmarshalURLSafeRequest

func UnmarshalURLSafeRequest(data []byte) (req *Request, err error)

UnmarshalURLSafeRequest will decode an encoded request. Remember not to trust any user data! THIS IS NOT SIGNED.

func UpdateRecordingRequest

func UpdateRecordingRequest(recordID string, params Params) *Request

UpdateRecordingRequest creates a request for updating a single recording. CAVEAT: It updates the recordID in params.

func UpdateRecordingsRequest

func UpdateRecordingsRequest(params Params) *Request

UpdateRecordingsRequest creates a new request for updating a recording.

func (*Request) HasBody

func (req *Request) HasBody() bool

HasBody checks for the presence of a request body

func (*Request) MarshalURLSafe

func (req *Request) MarshalURLSafe() []byte

MarshalURLSafe will encode the request in an urlsafe way using json+base64.

func (*Request) Sign

func (req *Request) Sign() string

Sign a request, with the backend secret.

func (*Request) String

func (req *Request) String() string

String creates a representation of the request

func (*Request) URL

func (req *Request) URL() string

URL builds the URL representation of the request, directed at a backend.

func (*Request) Verify

func (req *Request) Verify() error

Verify request coming from a frontend: Compare checksum with the checksum calculated from the incoming raw query string and the frontend secret

func (*Request) WithBackend

func (req *Request) WithBackend(b *Backend) *Request

WithBackend adds a backend to the request

func (*Request) WithFrontend

func (req *Request) WithFrontend(f *Frontend) *Request

WithFrontend adds a frontend to the request

type Response

type Response interface {
	Marshal() ([]byte, error)
	Merge(response Response) error

	Header() http.Header
	SetHeader(http.Header)

	Status() int
	SetStatus(int)

	IsSuccess() bool
}

Response interface

type SetConfigXMLResponse

type SetConfigXMLResponse struct {
	*XMLResponse
	Token string `xml:"token"`
}

SetConfigXMLResponse encodes the result of setting the config

func UnmarshalSetConfigXMLResponse

func UnmarshalSetConfigXMLResponse(
	data []byte,
) (*SetConfigXMLResponse, error)

UnmarshalSetConfigXMLResponse decodes the XML data

func (*SetConfigXMLResponse) Header

func (res *SetConfigXMLResponse) Header() http.Header

Header returns the HTTP response headers

func (*SetConfigXMLResponse) Marshal

func (res *SetConfigXMLResponse) Marshal() ([]byte, error)

Marshal encodes a SetConfigXMLResponse as XML

func (*SetConfigXMLResponse) Merge

func (res *SetConfigXMLResponse) Merge(other Response) error

Merge SetConfigXMLResponse

func (*SetConfigXMLResponse) SetHeader

func (res *SetConfigXMLResponse) SetHeader(h http.Header)

SetHeader sets the HTTP response headers

func (*SetConfigXMLResponse) SetStatus

func (res *SetConfigXMLResponse) SetStatus(s int)

SetStatus sets the HTTP response status code

func (*SetConfigXMLResponse) Status

func (res *SetConfigXMLResponse) Status() int

Status returns the HTTP response status code

type TextTrack

type TextTrack struct {
	Href   string `json:"href"`
	Kind   string `json:"kind"`
	Label  string `json:"label"`
	Source string `json:"source"`
}

TextTrack of a Recording

type Timestamp

type Timestamp uint64

Timestamp is the milliseconds passed since beginning of the epoch.

type UpdateRecordingsResponse

type UpdateRecordingsResponse struct {
	*XMLResponse
	Updated bool `xml:"updated"`
}

UpdateRecordingsResponse indicates if the update was successful in the attribute updated. Might be different from Returncode. I guess.

func UnmarshalUpdateRecordingsResponse

func UnmarshalUpdateRecordingsResponse(
	data []byte,
) (*UpdateRecordingsResponse, error)

UnmarshalUpdateRecordingsResponse decodes the XML data

func (*UpdateRecordingsResponse) Header

func (res *UpdateRecordingsResponse) Header() http.Header

Header returns the HTTP response headers

func (*UpdateRecordingsResponse) Marshal

func (res *UpdateRecordingsResponse) Marshal() ([]byte, error)

Marshal UpdateRecordingsResponse to XML

func (*UpdateRecordingsResponse) Merge

func (res *UpdateRecordingsResponse) Merge(other Response) error

Merge a UpdateRecordingsResponse

func (*UpdateRecordingsResponse) SetHeader

func (res *UpdateRecordingsResponse) SetHeader(h http.Header)

SetHeader sets the HTTP response headers

func (*UpdateRecordingsResponse) SetStatus

func (res *UpdateRecordingsResponse) SetStatus(s int)

SetStatus sets the HTTP response status code

func (*UpdateRecordingsResponse) Status

func (res *UpdateRecordingsResponse) Status() int

Status returns the HTTP response status code

type UserJoinedMeetingEvent

type UserJoinedMeetingEvent struct {
	InternalMeetingID string
	Attendee          *Attendee
}

UserJoinedMeetingEvent indicates that a user joined the meeting

type UserLeftMeetingEvent

type UserLeftMeetingEvent struct {
	InternalMeetingID string
	InternalUserID    string
	InternalID        string
}

UserLeftMeetingEvent indicates that a user has left the meeting

type XMLResponse

type XMLResponse struct {
	XMLName    xml.Name `xml:"response"`
	Returncode string   `xml:"returncode"`
	Message    string   `xml:"message,omitempty"`
	MessageKey string   `xml:"messageKey,omitempty"`
	Version    string   `xml:"version,omitempty"`
	// contains filtered or unexported fields
}

A XMLResponse from the server

func (*XMLResponse) Header

func (res *XMLResponse) Header() http.Header

Header returns the HTTP response headers

func (*XMLResponse) IsSuccess

func (res *XMLResponse) IsSuccess() bool

IsSuccess checks if the returncode of the response is 'SUCCESS'.

func (*XMLResponse) Marshal

func (res *XMLResponse) Marshal() ([]byte, error)

Marshal a XMLResponse to XML

func (*XMLResponse) Merge

func (res *XMLResponse) Merge(other Response) error

Merge XMLResponses. However, in general this should not be merged.

func (*XMLResponse) MergeXMLResponse

func (res *XMLResponse) MergeXMLResponse(other *XMLResponse) error

MergeXMLResponse is a specific merge

func (*XMLResponse) SetHeader

func (res *XMLResponse) SetHeader(h http.Header)

SetHeader sets the HTTP response headers

func (*XMLResponse) SetStatus

func (res *XMLResponse) SetStatus(s int)

SetStatus sets the HTTP response status code

func (*XMLResponse) Status

func (res *XMLResponse) Status() int

Status returns the HTTP response status code

Jump to

Keyboard shortcuts

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