Documentation
¶
Index ¶
- Constants
- type BodyFormMultipartDataError
- type BodyFormUrlencodedError
- type BodyJSONError
- type Client
- func (c *Client) CleanAdditionalHeaders(h map[string]string)
- func (c *Client) DELETE(route string, inData interface{}, outData interface{}, expectedStatusCode int) (statusCode int, respBody []byte, err error)
- func (c *Client) ErrorRawBody(contentType, rawBody string) string
- func (c *Client) GET(route string, outData interface{}, expectedStatusCode int) (statusCode int, respBody []byte, err error)
- func (c *Client) GetBodyFormMultipartData(urlAddr, method string, inData interface{}, addHeader *map[string]string) (reqBody io.Reader, reqRawBody string, err error)
- func (c *Client) GetBodyFormUrlencoded(urlAddr, method string, inData interface{}, addHeader *map[string]string) (reqBody io.Reader, reqRawBody string, err error)
- func (c *Client) GetBodyJSON(urlAddr, method string, inData interface{}, addHeader *map[string]string) (reqBody io.Reader, reqRawBody string, err error)
- func (c *Client) PATCH(route string, inData interface{}, outData interface{}, expectedStatusCode int) (statusCode int, respBody []byte, err error)
- func (c *Client) POST(route string, inData interface{}, outData interface{}, expectedStatusCode int) (statusCode int, respBody []byte, err error)
- func (c *Client) PUT(route string, inData interface{}, outData interface{}, expectedStatusCode int) (statusCode int, respBody []byte, err error)
- func (c *Client) Request(method, route string, inData interface{}, outData interface{}, ...) (statusCode int, respBody []byte, err error)
- func (c *Client) SetAdditionalHeaders(h map[string]string)
- type ClientError
- type CreateRequestError
- type EncoderError
- type FormDataError
- type LRC
- type MarshalingError
- type ReadResponseBodyError
- type UnMarshalingError
- type UnknownAuthTypeError
- type UnknownContentTypeError
- type WrongStatusCodeError
Constants ¶
View Source
const ( AuthTypeNone = iota AuthTypeLoginPass AuthTypeToken AuthTypeBearerToken AuthTypeCookieWithCSRFToken AuthTypeEDS )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BodyFormMultipartDataError ¶ added in v0.0.23
type BodyFormMultipartDataError struct {
FormDataError
}
type BodyFormUrlencodedError ¶ added in v0.0.23
type BodyFormUrlencodedError struct {
FormDataError
}
type BodyJSONError ¶ added in v0.0.23
type BodyJSONError struct {
FormDataError
}
type Client ¶
type Client struct { URL string ContentType string AuthType int Username string Password string Token string BearerToken string Cookie string XCSRFToken string SignKeyID string SignBody string // contains filtered or unexported fields }
func (*Client) CleanAdditionalHeaders ¶ added in v0.0.70
func (*Client) ErrorRawBody ¶ added in v0.0.23
func (*Client) GetBodyFormMultipartData ¶ added in v0.0.16
func (*Client) GetBodyFormUrlencoded ¶ added in v0.0.16
func (*Client) GetBodyJSON ¶ added in v0.0.16
func (*Client) SetAdditionalHeaders ¶ added in v0.0.70
type ClientError ¶
func (*ClientError) Error ¶
func (e *ClientError) Error() string
type CreateRequestError ¶
func (*CreateRequestError) Error ¶
func (e *CreateRequestError) Error() string
type EncoderError ¶
func (*EncoderError) Error ¶
func (e *EncoderError) Error() string
type FormDataError ¶ added in v0.0.23
func (*FormDataError) Error ¶ added in v0.0.23
func (e *FormDataError) Error() string
type LRC ¶
type LRC interface { Request( method, route string, inData interface{}, outData interface{}, expectedStatusCode int, ) (statusCode int, respBody []byte, err error) GET( route string, outData interface{}, expectedStatusCode int, ) (statusCode int, respBody []byte, err error) POST( route string, inData interface{}, outData interface{}, expectedStatusCode int, ) (statusCode int, respBody []byte, err error) PUT( route string, inData interface{}, outData interface{}, expectedStatusCode int, ) (statusCode int, respBody []byte, err error) PATCH( route string, inData interface{}, outData interface{}, expectedStatusCode int, ) (statusCode int, respBody []byte, err error) DELETE( route string, inData interface{}, outData interface{}, expectedStatusCode int, ) (statusCode int, respBody []byte, err error) }
type MarshalingError ¶
func (*MarshalingError) Error ¶
func (e *MarshalingError) Error() string
type ReadResponseBodyError ¶
func (*ReadResponseBodyError) Error ¶
func (e *ReadResponseBodyError) Error() string
type UnMarshalingError ¶
func (*UnMarshalingError) Error ¶
func (e *UnMarshalingError) Error() string
type UnknownAuthTypeError ¶
func (*UnknownAuthTypeError) Error ¶
func (e *UnknownAuthTypeError) Error() string
type UnknownContentTypeError ¶
func (*UnknownContentTypeError) Error ¶
func (e *UnknownContentTypeError) Error() string
Click to show internal directories.
Click to hide internal directories.