agora

package
v0.0.0-...-750a8a5 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MixRecord         = 2
	IndividualReocord = 3
)

record mode

View Source
const (
	Recording = 1
	NotRecord = 2
)
View Source
const (
	RoleAttendee   = 0
	RolePublisher  = 1
	RoleSubscriber = 2
	RoleAdmin      = 101
)

Role consts

View Source
const (
	RoleRtmUser = 1
)

Role consts

Variables

This section is empty.

Functions

func BuildToken

func BuildToken(appID string, appCertificate string, userAccount string, role RTMRole, privilegeExpiredTs uint32) (string, error)

BuildToken method appID: The App ID issued to you by Agora. Apply for a new App ID from

Agora Dashboard if it is missing from your kit. See Get an App ID.

appCertificate: Certificate of the application that you registered in

the Agora Dashboard. See Get an App Certificate.

userAccount: The user account. role: Role_Rtm_User = 1 privilegeExpireTs: represented by the number of seconds elapsed since

1/1/1970. If, for example, you want to access the
Agora Service within 10 minutes after the token is
generated, set expireTimestamp as the current
timestamp + 600 (seconds)./

func BuildTokenWithUID

func BuildTokenWithUID(appID string, appCertificate string, channelName string, uid uint32, role RTCRole, privilegeExpiredTs uint32) (string, error)

BuildTokenWithUID method appID: The App ID issued to you by Agora. Apply for a new App ID from

Agora Dashboard if it is missing from your kit. See Get an App ID.

appCertificate: Certificate of the application that you registered in

the Agora Dashboard. See Get an App Certificate.

channelName:Unique channel name for the AgoraRTC session in the string format userAccount: The user account. role: Role_Publisher = 1: A broadcaster (host) in a live-broadcast profile.

Role_Subscriber = 2: (Default) A audience in a live-broadcast profile.

privilegeExpireTs: represented by the number of seconds elapsed since

1/1/1970. If, for example, you want to access the
Agora Service within 10 minutes after the token is
generated, set expireTimestamp as the current

func BuildTokenWithUserAccount

func BuildTokenWithUserAccount(appID string, appCertificate string, channelName string, userAccount string, role RTCRole, privilegeExpiredTs uint32) (string, error)

BuildTokenWithUserAccount method appID: The App ID issued to you by Agora. Apply for a new App ID from

Agora Dashboard if it is missing from your kit. See Get an App ID.

appCertificate: Certificate of the application that you registered in

the Agora Dashboard. See Get an App Certificate.

channelName:Unique channel name for the AgoraRTC session in the string format uid: User ID. A 32-bit unsigned integer with a value ranging from

1 to (232-1). optionalUid must be unique.

role: Role_Publisher = 1: A broadcaster (host) in a live-broadcast profile.

Role_Subscriber = 2: (Default) A audience in a live-broadcast profile.

privilegeExpireTs: represented by the number of seconds elapsed since

1/1/1970. If, for example, you want to access the
Agora Service within 10 minutes after the token is
generated, set expireTimestamp as the current
timestamp + 600 (seconds)./

func GETQueryRecord

func GETQueryRecord(mode int8, sid string, rsid string) (int, error)

GETQueryRecord - 查询录制状态

func GetCandidateExamineeIDStr

func GetCandidateExamineeIDStr(uid uint) string

GetCandidateExamineeIDStr - 获取考生idstr

func GetCandidateMeetingNo

func GetCandidateMeetingNo(env string, id uint) string

GetCandidateMeetingNo - 获取侯考场id

func GetExamineeIDStr

func GetExamineeIDStr(uid uint) string

GetExamineeIDStr - 获取考生idstr

func GetInviteMeetingNo

func GetInviteMeetingNo(env string, examroomID uint, uids []uint, uid uint, isDualCamera int8) string

GetInviteMeetingNo - 获取面试候考区考场id

func GetMeetingNo

func GetMeetingNo(env string, id uint) string

GetMeetingNo - 获取考场id

func GetPageSize

func GetPageSize(isDualCamera int8) int

GetPageSize method

func GetRecordURL

func GetRecordURL(mode int8, sid string, cname string, uid uint) (string, string)

GetRecordURL - 获取录制url

func GetServerIDStr

func GetServerIDStr() string

GetServerIDStr - 获取服务端id,用于录制

func GetToken

func GetToken(cname string, uidStr string) (string, string, error)

GetToken - 获取token

func GetTotalPage

func GetTotalPage(total int, isDualCamera int8) int8

GetTotalPage method.

func GetWrittenMeetingNo

func GetWrittenMeetingNo(env string, examroomID uint, uids []uint, uid uint, isDualCamera int8) string

GetWrittenMeetingNo - 获取笔试考场id

func Init

func Init()

初始化配置

func ToInviteMeetingNo

func ToInviteMeetingNo(env string, examroomID uint, pageN int8) string

拼接面试候考区考场id

func ToWrittenMeetingNo

func ToWrittenMeetingNo(env string, examroomID uint, pageN int8) string

ToWrittenMeetingNo - 拼接笔试考场id

Types

type AcquireModel

type AcquireModel struct {
	ResourceID string `json:"resourceId"`
}

func POSTAcquire

func POSTAcquire(cname string, uid string) (*AcquireModel, error)

POSTAcquire return acquire

type KickingResponseModel

type KickingResponseModel struct {
	ID     uint   `json:"id"`
	Status string `json:"status"`
}

func KickingRule

func KickingRule(cname string, uid string) (*KickingResponseModel, error)

KickingRule - 踢人

type QueryResp

type QueryResp struct {
	ResourceID     string `json:"resourceId"`
	Sid            string `json:"sid"`
	ServerResponse struct {
		FileListMode string `json:"fileListMode"`
		FileList     []struct {
			Filename       string `json:"filename"`
			TrackType      string `json:"trackType"`
			UID            string `json:"uid"`
			MixedAllUser   bool   `json:"mixedAllUser"`
			IsPlayable     bool   `json:"isPlayable"`
			SliceStartTime int64  `json:"sliceStartTime"`
		} `json:"fileList"`
		Status         string `json:"status"`
		SliceStartTime int64  `json:"sliceStartTime"`
	} `json:"serverResponse"`
}

type RTCRole

type RTCRole uint16

RTCRole Type

type RTMRole

type RTMRole uint16

RTMRole Type

type ResponseModel

type ResponseModel struct {
	StartRecordModel
	ServerResp ServerResponse `json:"serverResponse"`
}

func POSTStopRecord

func POSTStopRecord(mode int8, sid string, rsid string, cname string, uid string) (*ResponseModel, error)

POSTStopRecord - 停止录制

type RtcTokenBuilder

type RtcTokenBuilder struct {
}

RtcTokenBuilder class

type RtmTokenBuilder

type RtmTokenBuilder struct {
}

RtmTokenBuilder class

type ServerResponse

type ServerResponse struct {
	FileList        string `json:"fileList"`
	UploadingStatus string `json:"uploadingStatus"`
	Status          string `json:"status"`
	SliceStartTime  string `json:"sliceStartTime"`
}

type StartRecordModel

type StartRecordModel struct {
	AcquireModel
	SID string `json:"sid"`
}

func POSTIndividualStartRecord

func POSTIndividualStartRecord(cname string, uid string, resourceID string) (*StartRecordModel, error)

POSTIndividualStartRecord - 开启录制

func POSTMixStartRecord

func POSTMixStartRecord(cname string, uid string, resourceID string) (*StartRecordModel, error)

POSTMixStartRecord - 开启录制

func POSTMixStartRecord2

func POSTMixStartRecord2(cname string, uid string, resourceID string, userID uint) (*StartRecordModel, error)

POSTMixStartRecord - 开启录制

type StatusModel

type StatusModel struct {
	ResourceID     string `json:"resourceId"`
	SID            string `json:"sid"`
	ServerResponse struct {
		FileList        string `json:"fileList"`
		UploadingStatus string `json:"uploadingStatus"`
		Status          int    `json:"status"`
		SliceStartTime  int    `json:"sliceStartTime"`
	}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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