Documentation
¶
Index ¶
- Constants
- func NewRizhiyidHTTPClient(timeout time.Duration, skipValidateTLS bool) (*http.Client, error)
- type Client
- func (c *Client) BuildRizhiyiURL(queryValues url.Values, urlPathParts ...string) url.URL
- func (c *Client) Delete(deleteURL url.URL) (*http.Response, error)
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) DoRequest(method string, requestURL url.URL, body interface{}) (*http.Response, error)
- func (c *Client) EncodeObject(content interface{}) ([]byte, error)
- func (c *Client) EncodeRequestBody(content interface{}) ([]byte, error)
- func (c *Client) Get(getURL url.URL) (*http.Response, error)
- func (c *Client) Login() (e error)
- func (c *Client) NewRequest(httpMethod, url string, body io.Reader) (*http.Request, error)
- func (c *Client) Patch(patchURL url.URL, body interface{}) (*http.Response, error)
- func (c *Client) Post(postURL url.URL, body interface{}) (*http.Response, error)
- func (c *Client) Put(putURL url.URL, body interface{}) (*http.Response, error)
Constants ¶
View Source
const ( MethodGet = "GET" MethodPost = "POST" MethodPut = "PUT" MethodPatch = "PATCH" MethodDelete = "DELETE" )
Declare constants for service package
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client is used to communicate with rizhiyi endpoints
func NewDefaultRizhiyidClient ¶
NewDefaultRizhiyidClient creates a Client with default values
func NewRizhiyidClient ¶
func NewRizhiyidClient(sessionKey string, auth [2]string, host string, httpClient *http.Client) (*Client, error)
NewRizhiyidClient creates a Client with custom values passed in
func NewRizhiyidClientWithAuthToken ¶
func NewRizhiyidClientWithAuthToken(authToken string, auth [2]string, host string, httpClient *http.Client) (*Client, error)
NewRizhiyidClient creates a Client with custom values passed in
func (*Client) BuildRizhiyiURL ¶
func (*Client) DoRequest ¶
func (c *Client) DoRequest(method string, requestURL url.URL, body interface{}) (*http.Response, error)
DoRequest creates and execute a new request
func (*Client) EncodeObject ¶
EncodeObject encodes an object into url-encoded string
func (*Client) EncodeRequestBody ¶
EncodeRequestBody takes a json string or object and serializes it to be used in request body
func (*Client) NewRequest ¶
NewRequest creates a new HTTP Request and set proper header
Click to show internal directories.
Click to hide internal directories.