Documentation
¶
Index ¶
- func ExtractBetween(body, left, right string) (string, error)
- func ParseCookies(resp *http.Response) map[string]string
- func ParseJSON(data []byte) (map[string]interface{}, error)
- func ParseXML(data io.Reader) (map[string]string, error)
- func ResponseBodyContains(responseBody []byte, searchStr string) bool
- func Second(seconds int) time.Duration
- type Config
- type RushGo
- func (rg *RushGo) Delete(url string) (*http.Response, error)
- func (rg *RushGo) DownloadImage(url string, savePath *string) (*http.Response, error)
- func (rg *RushGo) FollowRedirects() *RushGo
- func (rg *RushGo) Get(url string) (*http.Response, error)
- func (rg *RushGo) Head(url string) (*http.Response, error)
- func (rg *RushGo) Options(url string) (*http.Response, error)
- func (rg *RushGo) Patch(url string, body []byte) (*http.Response, error)
- func (rg *RushGo) Post(url string, body []byte) (*http.Response, error)
- func (rg *RushGo) Put(url string, body []byte) (*http.Response, error)
- func (rg *RushGo) SetCookies(cookies map[string]string) *RushGo
- func (rg *RushGo) SetHeaders(headers map[string]string) *RushGo
- func (rg *RushGo) WebSocketConnect(urlStr string) (*websocket.Conn, *http.Response, error)
- func (rg *RushGo) WithBasicAuth(username, password string) *RushGo
- func (rg *RushGo) WithBearerToken(token string) *RushGo
- func (rg *RushGo) WithCookies(cookies map[string]string) *RushGo
- func (rg *RushGo) WithHeaders(headers map[string]string) *RushGo
- func (rg *RushGo) WithProxy(proxyURL string) *RushGo
- func (rg *RushGo) WithTimeout(timeout time.Duration) *RushGo
- func (rg *RushGo) WithUserAgent(userAgent string) *RushGo
- type UserAgent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractBetween ¶
func ParseCookies ¶
ParseCookies extracts and parses cookies from an http.Response and returns them as a map
func ResponseBodyContains ¶
ResponseBodyContains checks if the response body contains a specific string
Types ¶
type RushGo ¶
type RushGo struct {
// contains filtered or unexported fields
}
RushGo struct to encapsulate the http client and default headers
func (*RushGo) DownloadImage ¶
DownloadImage downloads an image from the given URL and saves it to the specified path. If savePath is nil, the image is saved in the current working directory with its original filename. It returns the http.Response and an error, if any.
func (*RushGo) FollowRedirects ¶
func (*RushGo) SetCookies ¶
SetCookies sets cookies for the RushGo client without replacing the existing ones.
func (*RushGo) WebSocketConnect ¶
func (*RushGo) WithBasicAuth ¶
func (*RushGo) WithBearerToken ¶
func (*RushGo) WithCookies ¶
WithCookies sets cookies for the RushGo client's default headers.
func (*RushGo) WithHeaders ¶
WithHeaders sets default headers for the RushGo client