Documentation
¶
Index ¶
- type CookieHelper
- func (c *CookieHelper) CookiesSaved() (cookiesExist bool)
- func (c *CookieHelper) ExtractCSRF(jar http.CookieJar, baseDomain string) (csrf string)
- func (c *CookieHelper) ExtractLoginFormInputsCSRF(formHtml string) (formData *url.Values)
- func (c *CookieHelper) LoadCookies(jar http.CookieJar, baseDomain string) (err error)
- func (c *CookieHelper) SaveCookies(jar http.CookieJar, baseDomain string) (err error)
- type Header
- type Headers
- type HttpClient
- func (httpClient *HttpClient) GetCookieJar() http.CookieJar
- func (httpClient *HttpClient) RestGET(url string, rqHeaders *Headers, rs any) (err error)
- func (httpClient *HttpClient) RestPOST(url string, rqHeaders *Headers, rq any, rs any) (err error)
- func (httpClient *HttpClient) SimpleGET(url string, rqHeaders *Headers) (rs *Response, err error)
- func (httpClient *HttpClient) SimplePOST(url string, rqHeaders *Headers, formData *url.Values) (rs *Response, err error)
- func (httpClient *HttpClient) WithRequestLogger(f func(rq *http.Request, rqBody []byte, Error error)) *HttpClient
- func (httpClient *HttpClient) WithResponseLogger(...) *HttpClient
- func (httpClient *HttpClient) WithTimeout(duration time.Duration) *HttpClient
- type ICookieHelper
- type IHttpClient
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CookieHelper ¶
type CookieHelper struct {
// contains filtered or unexported fields
}
func (*CookieHelper) CookiesSaved ¶
func (c *CookieHelper) CookiesSaved() (cookiesExist bool)
func (*CookieHelper) ExtractCSRF ¶
func (c *CookieHelper) ExtractCSRF(jar http.CookieJar, baseDomain string) (csrf string)
func (*CookieHelper) ExtractLoginFormInputsCSRF ¶
func (c *CookieHelper) ExtractLoginFormInputsCSRF(formHtml string) (formData *url.Values)
func (*CookieHelper) LoadCookies ¶
func (c *CookieHelper) LoadCookies(jar http.CookieJar, baseDomain string) (err error)
func (*CookieHelper) SaveCookies ¶
func (c *CookieHelper) SaveCookies(jar http.CookieJar, baseDomain string) (err error)
type HttpClient ¶
func NewHttpClient ¶
func NewHttpClient() *HttpClient
func (*HttpClient) GetCookieJar ¶
func (httpClient *HttpClient) GetCookieJar() http.CookieJar
func (*HttpClient) RestGET ¶
func (httpClient *HttpClient) RestGET(url string, rqHeaders *Headers, rs any) (err error)
func (*HttpClient) SimpleGET ¶
func (httpClient *HttpClient) SimpleGET(url string, rqHeaders *Headers) (rs *Response, err error)
func (*HttpClient) SimplePOST ¶
func (*HttpClient) WithRequestLogger ¶
func (httpClient *HttpClient) WithRequestLogger(f func(rq *http.Request, rqBody []byte, Error error)) *HttpClient
func (*HttpClient) WithResponseLogger ¶
func (*HttpClient) WithTimeout ¶
func (httpClient *HttpClient) WithTimeout(duration time.Duration) *HttpClient
type ICookieHelper ¶
type ICookieHelper interface { CookiesSaved() (cookiesExist bool) SaveCookies(jar http.CookieJar, baseDomain string) (err error) LoadCookies(jar http.CookieJar, baseDomain string) (err error) ExtractCSRF(jar http.CookieJar, baseDomain string) (csrf string) ExtractLoginFormInputsCSRF(formHtml string) (formData *url.Values) }
func NewCookieHelper ¶
func NewCookieHelper(filePath string) ICookieHelper
type IHttpClient ¶
type IHttpClient interface { RestGET(url string, rqHeaders *Headers, rs any) (err error) // rs by ref (no generic in types) RestPOST(url string, rqHeaders *Headers, rq any, rs any) (err error) // rs by ref (no generic in types) SimpleGET(url string, rqHeaders *Headers) (rs *Response, err error) SimplePOST(url string, rqHeaders *Headers, formData *url.Values) (rs *Response, err error) GetCookieJar() (jar http.CookieJar) }
Click to show internal directories.
Click to hide internal directories.