Documentation ¶
Index ¶
- Constants
- Variables
- func NewJar(key, domain, u string) *cookiejar.Jar
- func ParseBody(client *http.Client, u string, v interface{}) error
- func ParseBodyHeader(client *http.Client, u string, header map[string]string) error
- func ParseBodyPost(client *http.Client, u string, reader io.Reader, v interface{}) error
- func ParseRawBody(client *http.Client, u string) ([]byte, error)
- func ResolveCookies(raw, domain string) []*http.Cookie
- func VerifyDate(raw string) error
Constants ¶
View Source
const ( BiliDomain = iota + 101 BiliSign // 签到 BiliBCount // 获取 B 币数量 )
B 站相关任务
View Source
const ( HPIDomain = iota + 201 HPISign // 签到 )
黑客派相关任务
View Source
const ( STGDomain = iota + 301 STGSign // 签到 )
Go 语言中文网相关任务
View Source
const ( V2exDomain = iota + 401 V2exSign // 签到 )
v2ex 相关任务
View Source
const ( SignIn = "sign in" Verify = "verify" Query = "query" GetToken = "get token" )
访问阶段定义
Variables ¶
View Source
var ( ErrorAuthFailed = errors.New("auth failed") ErrorLogNotFound = errors.New("log not found") ErrorSignInFailed = errors.New("sign in failed") ErrorDateNotMatch = errors.New("date not match") )
验证过程的错误
View Source
var ( ErrorUnsupportedDomain = errors.New("unsupported domain") ErrorUnsupportedType = errors.New("unsupported type") )
其他错误
View Source
var ( RetryNumber = 3 RetryInterval = 100 * time.Millisecond )
重试配置
View Source
var TypeMap = map[int]string{ BiliSign: "B站签到", BiliBCount: "B币查询", HPISign: "黑客派签到", STGSign: "Go语言中文网签到", V2exSign: "v2ex签到", }
TypeMap 任务字符串描述
Functions ¶
func ParseBodyHeader ¶
ParseBodyHeader 用于访问一个 url, 并且可以指定 http.Request header
func ParseBodyPost ¶
ParseBodyPost 可以指定 http.Request body
func ParseRawBody ¶
ParseRawBody 读取 body 为 []byte
func ResolveCookies ¶
ResolveCookies 从字符构造 http.Cookie
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.