Documentation ¶
Index ¶
- func GetLogDirName(protocol, baseDir string, url *url.URL) (string, error)
- func GetLogFName(protocol, baseDir string, method string, url *url.URL, fext string) (string, error)
- type Client
- type NetClient
- type NetRequest
- func (nrq *NetRequest) AddHeaders(headers http.Header) Request
- func (nrq *NetRequest) Do(method, urlS string) (Response, error)
- func (nrq *NetRequest) Get(url string) (Response, error)
- func (nrq *NetRequest) Post(url string) (Response, error)
- func (nrq *NetRequest) SetBody(body interface{}) Request
- func (nrq *NetRequest) SetBodyJson(body interface{}) Request
- func (nrq *NetRequest) SetCookie(name, value string) Request
- func (nrq *NetRequest) SetHeader(key string, value string) Request
- func (nrq *NetRequest) SetHeaders(headersM map[string]string) Request
- func (nrq *NetRequest) SetProtocol(prot string) Request
- type NetResponse
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { InsecureSkipHttpsVerify() Client SetTLSClientConfig(tlsCfg *tls.Config) Client Request() Request GetClient() *http.Client }
func NewLoggingNetClient ¶
func NewMockNetClient ¶
func NewNetClient ¶
func NewNetClient() Client
type NetClient ¶
func (*NetClient) InsecureSkipHttpsVerify ¶
type NetRequest ¶
func (*NetRequest) AddHeaders ¶
func (nrq *NetRequest) AddHeaders(headers http.Header) Request
func (*NetRequest) SetBody ¶
func (nrq *NetRequest) SetBody(body interface{}) Request
func (*NetRequest) SetBodyJson ¶
func (nrq *NetRequest) SetBodyJson(body interface{}) Request
func (*NetRequest) SetCookie ¶
func (nrq *NetRequest) SetCookie(name, value string) Request
func (*NetRequest) SetHeaders ¶
func (nrq *NetRequest) SetHeaders(headersM map[string]string) Request
func (*NetRequest) SetProtocol ¶
func (nrq *NetRequest) SetProtocol(prot string) Request
type NetResponse ¶
func (*NetResponse) Body ¶
func (nrs *NetResponse) Body() []byte
func (*NetResponse) BodyString ¶
func (nrs *NetResponse) BodyString() string
func (*NetResponse) DeJSON ¶
func (nrs *NetResponse) DeJSON(tgtData interface{}) error
func (*NetResponse) Header ¶
func (nrs *NetResponse) Header() http.Header
func (*NetResponse) Status ¶
func (nrs *NetResponse) Status() string
func (*NetResponse) StatusCode ¶
func (nrs *NetResponse) StatusCode() int
type Request ¶
type Request interface { Get(url string) (Response, error) Post(url string) (Response, error) Do(method, url string) (Response, error) SetProtocol(prot string) Request SetHeader(key string, value string) Request AddHeaders(headers http.Header) Request SetHeaders(headersM map[string]string) Request SetCookie(name, value string) Request SetBody(body interface{}) Request SetBodyJson(body interface{}) Request }
Click to show internal directories.
Click to hide internal directories.