Documentation ¶
Index ¶
- type Client
- func (c *Client) ConnectTimeout(timeout time.Duration)
- func (c Client) Delete(url string, query url.Values, body io.Reader) (*Response, error)
- func (c Client) Get(url string, query url.Values) (*Response, error)
- func (c Client) GetConnectTimeout() time.Duration
- func (c Client) GetReadWriteTimeout() time.Duration
- func (c *Client) Logger(logger Logger)
- func (c Client) Post(url string, query url.Values, body io.Reader) (*Response, error)
- func (c *Client) ReadWriteTimeout(timeout time.Duration)
- type Logger
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents HTTPS client connection with optional basic authentication
func NewAuthClient ¶
NewAuthClient returns new Client object with configured https transport and attached authentication. Parameter tlsConfig is optional and can be nil, the default TLSClientConfig of http.Transport will be used in this case.
func NewClient ¶
NewClient returns new Client object with transport configured for https. Parameter tlsConfig is optional and can be nil, the default TLSClientConfig of http.Transport will be used in this case.
func (*Client) ConnectTimeout ¶
ConnectTimeout sets connection timeout
func (Client) GetConnectTimeout ¶
GetConnectTimeout returns connection timeout for the object
func (Client) GetReadWriteTimeout ¶
GetReadWriteTimeout returns connection timeout for the object
func (*Client) ReadWriteTimeout ¶
ReadWriteTimeout sets read-write timeout
type Logger ¶
type Logger interface {
Logf(format string, args ...interface{})
}
A Logger represents an active logging object to log Client communication
type Response ¶
Response represents HTTPS client response
func (Response) Verify ¶
Verify checks the response has specified code and body with specified content type
func (Response) VerifyCode ¶
VerifyCode checks the response has specified code
func (Response) VerifyContentType ¶
VerifyContentType checks the response has specified content type
func (Response) VerifyJSON ¶
VerifyJSON checks the response has specified code and carries application/json body