httpclient

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCouldNotLogin login failed
	ErrCouldNotLogin = errors.New("could not login")
	// ErrNeedCaptcha try to login in browser first
	ErrNeedCaptcha = errors.New("login: need captcha")
)
View Source
var (
	//ErrCannotParseData cannot parse html data error
	ErrCannotParseData = errors.New("data: parse error")
)
View Source
var ErrCouldNotGetFormSession = errors.New("could not get form session")

ErrCouldNotGetFormSession get form session id failed

Functions

func LoginConfirm

func LoginConfirm(ctx context.Context, account interface{}, timeout time.Duration) error

LoginConfirm 验证账号密码

func Punch

func Punch(ctx context.Context, account interface{}, timeout time.Duration) error

Punch 打卡

func SetSslVerify added in v1.1.1

func SetSslVerify(verify bool)

SetSslVerify when set false, insecure connection will be allowed

Types

type Account added in v1.0.12

type Account struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

Account account info for login

func (Account) Name added in v1.0.12

func (a Account) Name() string

Name get the name of the account

Jump to

Keyboard shortcuts

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