accesstoken

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: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KJoinChannel        = 1
	KPublishAudioStream = 2
	KPublishVideoStream = 3
	KPublishDataStream  = 4

	KPublishAudiocdn           = 5
	KPublishVideoCdn           = 6
	KRequestPublishAudioStream = 7
	KRequestPublishVideoStream = 8
	KRequestPublishDataStream  = 9
	KInvitePublishAudioStream  = 10
	KInvitePublishVideoStream  = 11
	KInvitePublishDataStream   = 12

	KAdministrateChannel = 101
	KLoginRtm            = 1000
)
View Source
const APP_ID_LENGTH = 32
View Source
const VERSION_LENGTH = 3

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	AppID          string
	AppCertificate string
	ChannelName    string
	UidStr         string
	Ts             uint32
	Salt           uint32
	Message        map[uint16]uint32
	Signature      string
	CrcChannelName uint32
	CrcUid         uint32
	MsgRawContent  string
}

func CreateAccessToken

func CreateAccessToken(appID, appCertificate, channelName string, uid uint32) AccessToken

func CreateAccessToken2

func CreateAccessToken2(appID, appCertificate, channelName string, uid string) AccessToken

func (*AccessToken) AddPrivilege

func (token *AccessToken) AddPrivilege(privilege Privileges, expireTimestamp uint32)

func (*AccessToken) Build

func (token *AccessToken) Build() (string, error)

func (*AccessToken) FromString

func (token *AccessToken) FromString(originToken string) bool

type Privileges

type Privileges uint16

Jump to

Keyboard shortcuts

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