gummy

package module
v0.0.0-...-6984613 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseURL

func ParseURL(rawURL string) (*url.URL, error)

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

func (*Context) GetCookie

func (ctx *Context) GetCookie() string

func (*Context) GetHeader

func (ctx *Context) GetHeader(key string) string

func (*Context) GetHeaders

func (ctx *Context) GetHeaders() http.Header

func (*Context) SetAuth

func (ctx *Context) SetAuth(val string)

func (*Context) SetAuthBearerToken

func (ctx *Context) SetAuthBearerToken(token string)

func (*Context) SetCookie

func (ctx *Context) SetCookie(val string)

func (*Context) SetHeader

func (ctx *Context) SetHeader(key, val string)

func (*Context) SetHeaders

func (ctx *Context) SetHeaders(headers map[string]string)

func (*Context) SetProxy

func (ctx *Context) SetProxy(rawURL string) error

func (*Context) SetProxyCall

func (ctx *Context) SetProxyCall(proxy func(*http.Request) (*url.URL, error)) (err error)

type Gummy

type Gummy struct {
	// contains filtered or unexported fields
}

func NewGummy

func NewGummy() *Gummy

func (*Gummy) Delete

func (g *Gummy) Delete(rawURL string, parames ...interface{}) *Response

func (*Gummy) Get

func (g *Gummy) Get(rawURL string, parames ...interface{}) *Response

func (*Gummy) GetContext

func (g *Gummy) GetContext(host string) *Context

func (*Gummy) Post

func (g *Gummy) Post(rawURL string, parames ...interface{}) *Response

func (*Gummy) Put

func (g *Gummy) Put(rawURL string, parames ...interface{}) *Response

func (*Gummy) Request

func (g *Gummy) Request(method, rawURL string, parames ...interface{}) *Response

func (*Gummy) RequestURL

func (g *Gummy) RequestURL(methon, rawURL string, parames ...interface{}) *Response

func (*Gummy) SetHeader

func (g *Gummy) SetHeader(key, val string)

func (*Gummy) SetProxy

func (g *Gummy) SetProxy(rawURL string) error

type Response

type Response struct {
	// contains filtered or unexported fields
}

func (*Response) Body

func (res *Response) Body() (body io.ReadCloser, err error)

func (*Response) Expect

func (res *Response) Expect(contentTypes ...string) *Response

func (*Response) GetBytes

func (res *Response) GetBytes() (code int, data []byte, err error)

func (*Response) GetDocument

func (res *Response) GetDocument() (code int, dom *goquery.Document, err error)

func (*Response) GetJSON

func (res *Response) GetJSON(v any) (code int, err error)

func (*Response) GetString

func (res *Response) GetString() (code int, data string, err error)

func (*Response) Retry

func (res *Response) Retry(ns ...int) *Response

func (*Response) Sleep

func (res *Response) Sleep(d time.Duration) *Response

func (*Response) String

func (res *Response) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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