cmd

package
v0.0.0-...-0aefe92 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GenDocs

func GenDocs() error

func GenerateAdminToken

func GenerateAdminToken(appId string, secretKey string, expire int, values []string) (string, error)

func GenerateToken

func GenerateToken(tokenTmpl string, appId string, secretKey string, expire int, values []string) (string, error)

func GetChannel

func GetChannel(channelId string, token string) (string, error)

func VerifyToken

func VerifyToken(tokenString string, secretKey string) error

Types

type SkyWayAdminAuthToken

type SkyWayAdminAuthToken struct {
	Jti           string `json:"jti"`
	Iat           int    `json:"iat"`
	Exp           int    `json:"exp"`
	AppId         string `json:"appId"`
	jwt.MapClaims `json:"-"`
}

func DecodeAdminToken

func DecodeAdminToken(token string) (SkyWayAdminAuthToken, error)

type SkyWayAuthToken

type SkyWayAuthToken struct {
	Jti           string               `json:"jti"`
	Iat           int                  `json:"iat"`
	Exp           int                  `json:"exp"`
	Version       int                  `json:"version"`
	Scope         SkyWayAuthTokenScope `json:"scope"`
	jwt.MapClaims `json:"-"`
}

func DecodeToken

func DecodeToken(token string) (SkyWayAuthToken, error)

type SkyWayAuthTokenAppScope

type SkyWayAuthTokenAppScope struct {
	Id        string                        `json:"id"`
	Actions   []string                      `json:"actions"`
	Turn      bool                          `json:"turn"`
	Analytics bool                          `json:"analytics"`
	Channels  []SkyWayAuthTokenChannelScope `json:"channels"`
}

type SkyWayAuthTokenChannelScope

type SkyWayAuthTokenChannelScope struct {
	Id      string                       `json:"id"`
	Name    string                       `json:"name"`
	Actions []string                     `json:"actions"`
	Members []SkyWayAuthTokenMemberScope `json:"members"`
	SfuBots []SkyWayAuthTokenSfuBotScope `json:"sfuBots"`
}

type SkyWayAuthTokenForwardingScope

type SkyWayAuthTokenForwardingScope struct {
	Actions []string `json:"actions"`
}

type SkyWayAuthTokenMemberScope

type SkyWayAuthTokenMemberScope struct {
	Id           string                           `json:"id"`
	Name         string                           `json:"name"`
	Actions      []string                         `json:"actions"`
	Publication  SkyWayAuthTokenPublicationScope  `json:"publication"`
	Subscription SkyWayAuthTokenSubscriptionScope `json:"subscription"`
}

type SkyWayAuthTokenPublicationScope

type SkyWayAuthTokenPublicationScope struct {
	Actions []string `json:"actions"`
}

type SkyWayAuthTokenScope

type SkyWayAuthTokenScope struct {
	App SkyWayAuthTokenAppScope `json:"app"`
}

type SkyWayAuthTokenSfuBotScope

type SkyWayAuthTokenSfuBotScope struct {
	Actions     []string                         `json:"actions"`
	Forwardings []SkyWayAuthTokenForwardingScope `json:"forwardings"`
}

type SkyWayAuthTokenSubscriptionScope

type SkyWayAuthTokenSubscriptionScope struct {
	Actions []string `json:"actions"`
}

Jump to

Keyboard shortcuts

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