api

package
v0.0.0-...-cea8561 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CREATE             action = "create"
	END                action = "end"
	GET_MEETINGS       action = "getMeetings"
	IS_MEETING_RUNNING action = "isMeetingRunning"
	JOIN               action = "join"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiRequest

type ApiRequest struct {
	Url     string
	Secret  string
	Shatype SHA
}

func NewRequest

func NewRequest(url string, secret string, shatype SHA) (*ApiRequest, error)

Create an object for making http get api requests to the BBB server. The requests are described here: https://bigbluebutton.org/api-mate/ and https://docs.bigbluebutton.org/dev/api.html

func (*ApiRequest) CreateMeeting

func (api *ApiRequest) CreateMeeting(name string, meetingID string, attendeePW string, moderatorPW string, welcome string, allowStartStopRecording bool, autoStartRecording bool, record bool, voiceBridge int64) (Meeting, error)

Makes a http get request to the BigBlueButton API, creates a meeting and returns this new meeting

func (*ApiRequest) EndMeeting

func (api *ApiRequest) EndMeeting(meetingID string) (Meeting, error)

Makes a http get request to the BigBlueButton API and returns the closed meeting

func (*ApiRequest) GetMeetings

func (api *ApiRequest) GetMeetings() (map[string]Meeting, error)

Makes a http get request to the BigBlueButton API and returns a list of meetings

func (*ApiRequest) IsMeetingRunning

func (api *ApiRequest) IsMeetingRunning(meetingID string) bool

Makes a http get request to the BigBlueButton API and returs the running state of the meeting. If an error occurs the returned value is false

func (*ApiRequest) Join

func (api *ApiRequest) Join(meetingID string, userName string, moderator bool) (string, []*http.Cookie, string, string, string, string, error)

Makes a http get request to the BigBlueButton API to join a meeting and returs: - url - cookie - userid - auth_token - session_token - internal_meeting_id - error

func (*ApiRequest) JoinGetURL

func (api *ApiRequest) JoinGetURL(meetingID string, userName string, moderator bool) (string, error)

Makes a http get request to the BigBlueButton API to join a meeting and returs: - url

type Attendee

type Attendee struct {
	UserID         string `xml:"userID" json:"userID"`
	FullName       string `xml:"fullName" json:"fullName"`
	Role           string `xml:"role" json:"role"`
	IsPresenter    bool   `xml:"isPresenter" json:"isPresenter"`
	IsListening    bool   `xml:"isListeningOnly" json:"isListeningOnly"`
	HasJoinedVoice bool   `xml:"hasJoinedVoice" json:"hasJoinedVoice"`
	HasVideo       bool   `xml:"hasVideo" json:"hasVideo"`
	ClientType     string `xml:"clientType" json:"clientType"`
}

type Meeting

type Meeting struct {
	MeetingName   string     `xml:"meetingName" json:"meetingName"`
	MeetingID     string     `xml:"meetingID" json:"meetingID"`
	InternalID    string     `xml:"internalMeetingID" json:"internalMeetingID"`
	CreateTime    int64      `xml:"createTime" json:"createTime"`
	CreateDate    string     `xml:"createDate" json:"createDate"`
	VoiceBridge   int        `xml:"voiceBridge" json:"voiceBridge"`
	DialNumber    string     `xml:"dialNumber" json:"dialNumber"`
	AttendeePW    string     `xml:"attendeePW" json:"attendeePW"`
	ModeratorPW   string     `xml:"moderatorPW" json:"moderatorPW"`
	Running       bool       `xml:"running" json:"running"`
	Duration      int        `xml:"duration" json:"duration"`
	HasJoined     bool       `xml:"hasUserJoined" json:"hasUserJoined"`
	Recording     bool       `xml:"recording" json:"recording"`
	ForciblyEnded bool       `xml:"hasBeenForciblyEnded" json:"hasBeenForciblyEnded"`
	StartTime     int64      `xml:"startTime" json:"startTime"`
	EndTime       int64      `xml:"endTime" json:"endTime"`
	Participants  int        `xml:"participantCount" json:"participantCount"`
	Listeners     int        `xml:"listenerCount" json:"listenerCount"`
	VoiceCount    int        `xml:"voiceParticipantCount" json:"voiceParticipantCount"`
	VideoCount    int        `xml:"videoCount" json:"videoCount"`
	MaxUsers      int        `xml:"maxUsers" json:"maxUsers"`
	Moderators    int        `xml:"moderatorCount" json:"moderatorCount"`
	Attendees     []Attendee `xml:"attendees>attendee" json:"attendees"`
	Metadata      Metadata   `xml:"metadata" json:"metadata"`
	IsBreakout    bool       `xml:"isBreakout" json:"isBreakout"`
}

type Metadata

type Metadata struct {
	OriginVersion    string `xml:"bbb-origin-version" json:"bbbOriginVersion"`
	OriginServerName string `xml:"bbb-origin-server-name" json:"bbbOriginServerName"`
	Origin           string `xml:"bbb-origin" json:"bbbOrigin"`
	Listed           bool   `xml:"gl-listed" json:"glListed"`
}

type ParamName

type ParamName string

Only those parames are allowed

const (
	MEETING_ID                 ParamName = "meetingID"
	RECORD_ID                  ParamName = "recordID"
	NAME                       ParamName = "name"
	ATTENDEE_PW                ParamName = "attendeePW"
	MODERATOR_PW               ParamName = "moderatorPW"
	PASSWORD                   ParamName = "password" //same as moderatorPW (I dont know why its sometimse called password and not moderatorPW)
	FULL_NAME                  ParamName = "fullName"
	WELCOME                    ParamName = "welcome"
	VOICE_BRIDGE               ParamName = "voiceBridge"
	RECORD                     ParamName = "record"
	AUTO_START_RECORDING       ParamName = "autoStartRecording"
	ALLOW_START_STOP_RECORDING ParamName = "allowStartStopRecording"
	DIAL_NUMBER                ParamName = "dialNumber"
	WEB_VOICE                  ParamName = "webVoice"
	LOGOUT_URL                 ParamName = "logoutURL"
	MAX_PARTICIPANTS           ParamName = "maxParticipants"
	DURATION                   ParamName = "duration"
	USER_ID                    ParamName = "userID"
	CREATE_TIME                ParamName = "createTime"
	WEB_VOICE_CONF             ParamName = "webVoiceConf"
	PUBLISH                    ParamName = "publish"
	REDIRECT                   ParamName = "redirect"
	CLIENT_URL                 ParamName = "clientURL"
	CONFIG_TOKEN               ParamName = "configToken"
	AVATAR_URL                 ParamName = "avatarURL"
	MODERATOR_ONLY_MESSAGE     ParamName = "moderatorOnlyMessage"
)

type Params

type Params struct {
	Name  ParamName
	Value string
}

type Responseerror

type Responseerror struct {
	Key     string `xml:"key"`
	Message string `xml:"message"`
}

type Responsegetmeetings

type Responsegetmeetings struct {
	Script     string          `xml:"script" json:"script"`
	ReturnCode string          `xml:"returncode" json:"returnCode"`
	Errors     []responseerror `xml:"errors>error" json:"errors"`
	Meetings   []Meeting       `xml:"meetings>meeting" json:"meetings"`
	MessageKey string          `xml:"messageKey" json:"messageKey"`
	Message    string          `xml:"message" json:"message"`
}

type SHA

type SHA string
const (
	SHA1   SHA = "SHA1"
	SHA256 SHA = "SHA256"
)

Jump to

Keyboard shortcuts

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