authorization

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

* @Author: 2Kil * @Date: 2026-01-07 18:48:47 * @LastEditors: 2Kil * @LastEditTime: 2026-01-07 22:37:53 * @Description:简单授权

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accredit

type Accredit struct {
	Sn   string
	Time string
}

Accredit 导出结构体,包含授权信息的序列号和时间

type Client

type Client struct {
	Code string //二维码网址
	Pwd  string //密码
	Data []Accredit
	// contains filtered or unexported fields
}

Client 授权客户端,用于管理请求和缓存

func NewClient

func NewClient(code string, pwd ...string) *Client

NewClient 创建一个新的客户端实例

func (*Client) CheckAccredit

func (c *Client) CheckAccredit(key string) bool

CheckAccredit 检查指定 key 的授权是否有效

func (*Client) GetAccredit

func (c *Client) GetAccredit() ([]Accredit, error)

GetAccredit 获取授权信息,更新内部缓存并返回数据 旧版活码 url格式 active.clewm.net/q8tDtnl

func (*Client) GetAccredit2 added in v1.0.12

func (c *Client) GetAccredit2() ([]Accredit, error)

GetAccredit2 获取授权信息,更新内部缓存并返回数据 新版活码 url格式 qr61.cn/o78kxB/q8tDtnl

Jump to

Keyboard shortcuts

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