Documentation
¶
Index ¶
- Variables
- func Base64(s []byte) string
- func Md5(token, password string) (string, error)
- func Sha1(content string) string
- func XDecode(encodedContent []byte, key string) string
- func XEncode(content string, key string) []byte
- type Api
- func (a *Api) GetChallenge(username, ip string) (map[string]interface{}, error)
- func (a *Api) GetUserInfo() (map[string]interface{}, error)
- func (a *Api) Init(conf *ApiConfig)
- func (a *Api) Login(req *LoginRequest) (map[string]interface{}, error)
- func (a *Api) NewDetector() *Detector
- func (a *Api) WithLogger(logger log.FieldLogger) *Api
- type ApiConfig
- type Conf
- type Detector
- func (d *Detector) DetectAcid() (string, error)
- func (d *Detector) DetectEnc() (string, error)
- func (d *Detector) DetectIp() (string, error)
- func (d *Detector) Reality(addr string, getAcid bool) (acid string, online bool, err error)
- func (d *Detector) Reset()
- func (d *Detector) WithLogger(logger log.FieldLogger) *Detector
- type LoginForm
- type LoginInfo
- type LoginMeta
- type LoginRequest
- type Srun
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Api ¶
type Api struct {
BaseUrl string
Client *http.Client
// 禁用自动重定向
NoDirect *http.Client
CustomHeader map[string]interface{}
Logger log.FieldLogger
}
func (*Api) GetChallenge ¶
func (*Api) GetUserInfo ¶
func (*Api) NewDetector ¶ added in v1.5.1
func (*Api) WithLogger ¶ added in v1.6.4
func (a *Api) WithLogger(logger log.FieldLogger) *Api
type Detector ¶ added in v1.5.1
type Detector struct {
Logger log.FieldLogger
// contains filtered or unexported fields
}
func (*Detector) DetectAcid ¶ added in v1.5.1
DetectAcid err 为 nil 时 acid 一定存在
func (*Detector) WithLogger ¶ added in v1.6.4
func (d *Detector) WithLogger(logger log.FieldLogger) *Detector
type LoginMeta ¶
type LoginMeta struct {
N string `json:"n" yaml:"n"`
Type string `json:"type" yaml:"type"`
Acid string `json:"acid" yaml:"acid"`
Enc string `json:"enc" yaml:"enc"`
OS string `json:"os" yaml:"os"`
Name string `json:"name" yaml:"name"`
InfoPrefix string `json:"info_prefix" yaml:"info_prefix"`
DoubleStack bool `json:"double_stack" yaml:"double_stack"`
}
type LoginRequest ¶ added in v1.4.5
Click to show internal directories.
Click to hide internal directories.