token

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: Apache-2.0 Imports: 4 Imported by: 8

Documentation

Overview

Package token 用于调用 openapi,websocket 的 token 对象。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	AppID       uint64
	AccessToken string
	Type        Type
}

Token 用于调用接口的 token 结构

func BotToken

func BotToken(appID uint64, accessToken string) *Token

BotToken 机器人身份的 token

func New

func New(tokenType Type) *Token

New 创建一个新的 Token

func UserToken

func UserToken(appID uint64, accessToken string) *Token

UserToken 用户身份的token

func (*Token) GetString

func (t *Token) GetString() string

GetString 获取授权头字符串

func (*Token) LoadFromConfig

func (t *Token) LoadFromConfig(file string) error

LoadFromConfig 从配置中读取 appid 和 token

type Type

type Type string

Type token 类型

const (
	TypeBot    Type = "Bot"
	TypeNormal Type = "Bearer"
)

TokenType

Jump to

Keyboard shortcuts

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