Documentation ¶
Index ¶
- Constants
- Variables
- func AuthNeededHandler(h http.Handler) http.Handler
- func Error(rw http.ResponseWriter, err string, status int)
- func ExpectDeepEqual(t *testing.T, actual, expected interface{}) bool
- func ExpectStatus(t *testing.T, actual, expected int) bool
- func HeadersHandler(h http.Handler) http.Handler
- func JSON(rw http.ResponseWriter, v interface{}, status int, err error)
- func Language(req *http.Request) language.Tag
- func NewFloat32(f float32) *float32
- func NotFound(rw http.ResponseWriter, _ *http.Request)
- func TrimmedTexts(s *goquery.Selection) []string
- type Client
- func (client *Client) FileInfo(url string, encoding encoding.Encoding) (filename string, size int, status int, errMsg error)
- func (client *Client) GetDocument(url string) (doc *goquery.Document, errMsg error)
- func (client *Client) GetJSON(url string, v interface{}) error
- func (client *Client) PostFormJSON(url string, data url.Values, v interface{}) error
- func (client *Client) WithJar()
- type Limiter
- type StatusGroup
Constants ¶
View Source
const (
UserId = "2013011187"
)
Variables ¶
View Source
var (
Password = os.Getenv("thu_pass")
)
View Source
var SupportedLanguageMatcher = language.NewMatcher([]language.Tag{ language.SimplifiedChinese, language.English, })
Functions ¶
func ExpectDeepEqual ¶
func NewFloat32 ¶
func TrimmedTexts ¶
Types ¶
type Limiter ¶
type Limiter struct { sync.Mutex Window int64 // In seconds. RateLimit int Count map[string]int Reset int64 }
func NewLimiter ¶
type StatusGroup ¶
func NewStatusGroup ¶
func NewStatusGroup() *StatusGroup
func (*StatusGroup) Done ¶
func (sg *StatusGroup) Done(statusPtr *int, errPtr *error)
func (*StatusGroup) Go ¶
func (sg *StatusGroup) Go(f func(*int, *error))
func (*StatusGroup) Wait ¶
func (sg *StatusGroup) Wait() (int, error)
Click to show internal directories.
Click to hide internal directories.