Documentation
¶
Index ¶
- func CleanCookie(url *url.URL) error
- func DELETE(u string, opts ...Option) (raw json.RawMessage, err error)
- func Dir() string
- func File(u, method string, opts ...Option) (io io.Reader, err error)
- func Fnv(msg string) uint64
- func GET(u string, opts ...Option) (raw json.RawMessage, err error)
- func GetCookie(url *url.URL, name string) *http.Cookie
- func GetCookies(url *url.URL) []*http.Cookie
- func HEAD(u string, opts ...Option) (raw json.RawMessage, err error)
- func Hash(key, msg string) string
- func Is(s string) bool
- func IsPrint(s string) bool
- func MD5(msg string) []byte
- func PATCH(u string, opts ...Option) (raw json.RawMessage, err error)
- func POST(u string, opts ...Option) (raw json.RawMessage, err error)
- func PUT(u string, opts ...Option) (raw json.RawMessage, err error)
- func ReadFile(filepath string, data interface{}) error
- func RegisterConnTimeout(timeout, longTimeout time.Duration)
- func RegisterCookieFun(name string)
- func RegisterCookieJar(name string)
- func RegisterDNS(dns []string)
- func RegisterDNSTimeout(timeout time.Duration)
- func RegisterDialerTimeout(timeout time.Duration)
- func RegisterInitCookie(name, cookie, endpoint string)
- func RegisterProxy(proxy func(*http.Request) (*url.URL, error))
- func Request(method, u string, opts ...Option) (json.RawMessage, http.Header, error)
- func SetCookie(url *url.URL, name, value string)
- func Sha256(msg string) string
- func ToLower(s string) (lower string, ok bool)
- func UserAgent(args ...int) string
- func WriteFile(filepath string, data interface{}) error
- type ClientOption
- func WithClientCookieFun(name string) ClientOption
- func WithClientCookieJar(name string) ClientOption
- func WithClientDNS(dns []string) ClientOption
- func WithClientProxy(proxy func(*http.Request) (*url.URL, error)) ClientOption
- func WithConnTimeout(timeout, longTimeout time.Duration) ClientOption
- func WithDNSTimeout(timeout time.Duration) ClientOption
- func WithDialerTimeout(timeout time.Duration) ClientOption
- func WithInitClientCookie(name, cookie, endpoint string) ClientOption
- type CodeError
- type CustomerCookie
- type EmbedClient
- func (c *EmbedClient) CleanCookie(u *url.URL) error
- func (c *EmbedClient) DELETE(u string, opts ...Option) (raw json.RawMessage, err error)
- func (c *EmbedClient) File(u, method string, opts ...Option) (io io.Reader, err error)
- func (c *EmbedClient) GET(u string, opts ...Option) (raw json.RawMessage, err error)
- func (c *EmbedClient) GetCookie(url *url.URL, name string) *http.Cookie
- func (c *EmbedClient) GetCookies(url *url.URL) []*http.Cookie
- func (c *EmbedClient) HEAD(u string, opts ...Option) (raw json.RawMessage, err error)
- func (c *EmbedClient) PATCH(u string, opts ...Option) (raw json.RawMessage, err error)
- func (c *EmbedClient) POST(u string, opts ...Option) (raw json.RawMessage, err error)
- func (c *EmbedClient) PUT(u string, opts ...Option) (raw json.RawMessage, err error)
- func (c *EmbedClient) Request(method, u string, opts ...Option) (json.RawMessage, http.Header, error)
- func (c *EmbedClient) SetCookie(u *url.URL, name, value string)
- 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 WithCacheDebug(periodMS ...int64) Option
- func WithContext(ctx context.Context) Option
- func WithDebug() Optiondeprecated
- func WithDump() Option
- func WithHeader(header map[string]string) Option
- func WithProxy(f func(*http.Request) (*url.URL, error)) Option
- func WithProxyDail(f func(ctx context.Context, network, addr string) (net.Conn, error)) Option
- func WithRandomHost(f func(string) string) Option
- func WithRetry(retry uint) Option
- func WithTest(periodMS ...int64) Optiondeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToLower ¶
ToLower returns the lowercase version of s if s is ASCII and printable.
Types ¶
type ClientOption ¶
type ClientOption interface {
// contains filtered or unexported methods
}
func WithClientCookieFun ¶
func WithClientCookieFun(name string) ClientOption
func WithClientCookieJar ¶
func WithClientCookieJar(name string) ClientOption
func WithClientDNS ¶
func WithClientDNS(dns []string) ClientOption
func WithClientProxy ¶
func WithConnTimeout ¶
func WithConnTimeout(timeout, longTimeout time.Duration) ClientOption
func WithDNSTimeout ¶
func WithDNSTimeout(timeout time.Duration) ClientOption
func WithDialerTimeout ¶
func WithDialerTimeout(timeout time.Duration) ClientOption
func WithInitClientCookie ¶
func WithInitClientCookie(name, cookie, endpoint string) ClientOption
type CodeError ¶
type CustomerCookie ¶
type EmbedClient ¶
func NewClient ¶
func NewClient(opts ...ClientOption) *EmbedClient
func (*EmbedClient) CleanCookie ¶
func (c *EmbedClient) CleanCookie(u *url.URL) error
func (*EmbedClient) DELETE ¶
func (c *EmbedClient) DELETE(u string, opts ...Option) (raw json.RawMessage, err error)
func (*EmbedClient) File ¶
func (*EmbedClient) GET ¶
func (c *EmbedClient) GET(u string, opts ...Option) (raw json.RawMessage, err error)
func (*EmbedClient) GetCookie ¶
func (*EmbedClient) HEAD ¶
func (c *EmbedClient) HEAD(u string, opts ...Option) (raw json.RawMessage, err error)
func (*EmbedClient) PATCH ¶
func (c *EmbedClient) PATCH(u string, opts ...Option) (raw json.RawMessage, err error)
func (*EmbedClient) POST ¶
func (c *EmbedClient) POST(u string, opts ...Option) (raw json.RawMessage, err error)
func (*EmbedClient) PUT ¶
func (c *EmbedClient) PUT(u string, opts ...Option) (raw json.RawMessage, err error)
func (*EmbedClient) Request ¶
func (c *EmbedClient) Request(method, u string, opts ...Option) (json.RawMessage, http.Header, error)
func (*EmbedClient) SetCookie ¶
func (c *EmbedClient) SetCookie(u *url.URL, name, value string)
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"`
}
Source Files
¶
- client.go
- client_option.go
- conn.go
- cookie.go
- entry_1.23.go
- hash.go
- init.go
- request_option.go
Click to show internal directories.
Click to hide internal directories.