v2

package
v0.0.0-...-faf7e35 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OnlineUrl   = "https://open-anubis.ele.me/anubis-webapi"
	NoOnlineUrl = "https://exam-anubis.ele.me/anubis-webapi"
	Timeout     = 5000 // 超时时间 5000ms
)

visit: https://open.ele.me/documents/ka/1419

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	Client         *http.Client // Change this to your actual client type
	AppID          string
	AppSecret      string
	Salt           int
	Host           string
	URL            string
	AccessTokenURL string
	RequestData    string // 请求参数map
}

func New

func New(appID, appSecret string, online bool) *Base

New is the constructor for the Base struct

func (*Base) AccessTokenSign

func (b *Base) AccessTokenSign() string

AccessTokenSign generates a signature for the access token

func (*Base) GetAccessToken

func (b *Base) GetAccessToken() (string, int64, error)

GetAccessToken returns the access token visit: https://open.ele.me/documents/ka/1371

func (*Base) Result

func (b *Base) Result() (string, error)

Result 获取结果

func (*Base) SetAccessTokenUrl

func (b *Base) SetAccessTokenUrl(_url string)

func (*Base) Sign

func (b *Base) Sign(data map[string]interface{}, accessToken string) string

Sign generates a signature

func (*Base) WithRequestParams

func (b *Base) WithRequestParams(_url string, data map[string]interface{}, accessToken string) *Base

WithRequestParams ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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