auth

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DelToken

func DelToken(ctx context.Context, token string, config publics.GeTuiConfig) (publics.PublicResult, error)

DelToken 删除token,为防止token被滥用或泄露,开发者可以调用此接口主动使token失效

Types

type TokenParam

type TokenParam struct {
	Sign      string `json:"sign"`      // 加密算法: SHA256,格式:sha256(appkey+timestamp+mastersecret)
	Timestamp string `json:"timestamp"` // 毫秒时间戳,请使用当前毫秒时间戳,误差太大可能出错
	AppKey    string `json:"appkey"`    // 创建应用时生成的appkey
}

type TokenResult

type TokenResult struct {
	publics.PublicResult
	Data TokenResultData
}

TokenResult Token返回结构

func GetToken

func GetToken(ctx context.Context, config publics.GeTuiConfig) (TokenResult, error)

GetToken 获取token

type TokenResultData

type TokenResultData struct {
	ExpireTime string `json:"expire_time"`
	Token      string `json:"token"`
}

TokenResultData Token返回的data结构

Jump to

Keyboard shortcuts

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