Documentation ¶
Index ¶
- func CheckRedirect(fun func(req *http.Request, via []*http.Request) error)
- func DELETE(u string, opts ...Option) (raw json.RawMessage, err error)
- func File(u, method string, opts ...Option) (io io.Reader, err error)
- func GET(u string, opts ...Option) (raw json.RawMessage, err error)
- func GetCookie(url *url.URL, name string) *http.Cookie
- func Hash(key, msg string) string
- func JarDir() string
- func MD5(msg string) []byte
- func NewPrivateKey() (*ecdsa.PrivateKey, error)
- func NewPrivateKeyFromBytes(priv []byte) *ecdsa.PrivateKey
- func NewPrivateKeyFromHex(hex_ string) (*ecdsa.PrivateKey, error)
- func POST(u string, opts ...Option) (raw json.RawMessage, err error)
- func PUT(u string, opts ...Option) (raw json.RawMessage, err error)
- func PrivateKeyToBytes(private *ecdsa.PrivateKey) []byte
- func PrivateKeyToHex(private *ecdsa.PrivateKey) string
- func PublicKeyToBytes(public *ecdsa.PublicKey) []byte
- func PublicKeyToHex(public *ecdsa.PublicKey) string
- func ReadFile(filepath string, data interface{}) error
- func RegisterDNS(dns []string)
- func RegisterFileJar()
- func RegisterProxy(proxy func(*http.Request) (*url.URL, error))
- func Request(method, u string, opts ...Option) (json.RawMessage, http.Header, error)
- func SOCKET(u string, header map[string]string) (conn *websocket.Conn, raw json.RawMessage, err error)
- func Sha256(msg string) string
- func SyncJar()
- func UserAgent(args ...int) string
- func WriteFile(filepath string, data interface{}) error
- type CodeError
- type EmptyDialOption
- type Group
- type Jar
- type Option
- func WithAfterResponse(f func(w *http.Response)) Option
- func WithBeforeRequest(f func(r *http.Request)) Option
- func WithBody(body interface{}) Option
- func WithContext(ctx context.Context) Option
- func WithHeader(header map[string]string) Option
- func WithProxy(f func(*http.Request) (*url.URL, error)) Option
- func WithRandomHost(f func(string) string) Option
- func WithRetry(retry uint) Option
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckRedirect ¶ added in v1.3.9
func NewPrivateKey ¶ added in v1.5.8
func NewPrivateKey() (*ecdsa.PrivateKey, error)
func NewPrivateKeyFromBytes ¶ added in v1.5.8
func NewPrivateKeyFromBytes(priv []byte) *ecdsa.PrivateKey
func NewPrivateKeyFromHex ¶ added in v1.5.8
func NewPrivateKeyFromHex(hex_ string) (*ecdsa.PrivateKey, error)
func PrivateKeyToBytes ¶ added in v1.5.8
func PrivateKeyToBytes(private *ecdsa.PrivateKey) []byte
func PrivateKeyToHex ¶ added in v1.5.8
func PrivateKeyToHex(private *ecdsa.PrivateKey) string
func PublicKeyToBytes ¶ added in v1.5.8
func PublicKeyToHex ¶ added in v1.5.8
func RegisterDNS ¶ added in v1.3.7
func RegisterDNS(dns []string)
func RegisterFileJar ¶ added in v1.3.9
func RegisterFileJar()
func RegisterProxy ¶ added in v1.5.5
Types ¶
type Group ¶ added in v1.3.0
type Group struct {
// contains filtered or unexported fields
}
Group represents a class of work and forms a namespace in which units of work can be executed with duplicate suppression.
func (*Group) Do ¶ added in v1.3.0
func (g *Group) Do(key string, fn func() (interface{}, error)) (v interface{}, err error, shared bool)
Do executes and returns the results of the given function, making sure that only one execution is in-flight for a given key at a time. If a duplicate comes in, the duplicate caller waits for the original to complete and receives the same results. The return value shared indicates whether v was given to multiple callers.
type Jar ¶
type Jar struct { PsList cookiejar.PublicSuffixList `json:"pslist"` // mu locks the remaining fields. Mu sync.Mutex `json:"mu"` // entries is a set of entries, keyed by their eTLD+1 and subkeyed by // their name/domain/path. Entries map[string]map[string]entry `json:"entries"` // nextSeqNum is the next sequence number assigned to a new cookie // created SetCookies. NextSeqNum uint64 `json:"nextseqnum"` }
type Option ¶ added in v1.5.0
type Option interface {
// contains filtered or unexported methods
}
func WithAfterResponse ¶ added in v1.5.0
func WithBeforeRequest ¶ added in v1.5.0
func WithContext ¶ added in v1.5.0
func WithHeader ¶ added in v1.5.0
func WithRandomHost ¶ added in v1.5.8
Source Files ¶
Click to show internal directories.
Click to hide internal directories.