Documentation ¶
Index ¶
- func BuildURL(subDomain, path string) (url string)
- type Client
- func (c *Client) DebugMode(debugMode bool)
- func (c Client) Delete(subDomain string, path string, data interface{}) (body []byte, header http.Header, err error)
- func (c Client) Get(subDomain string, path string, v *url.Values) (body []byte, header http.Header, err error)
- func (c Client) Options(subDomain string, path string, data interface{}) (body []byte, header http.Header, err error)
- func (c Client) Patch(subDomain string, path string, data interface{}) (body []byte, header http.Header, err error)
- func (c Client) Post(subDomain string, path string, data interface{}) (body []byte, header http.Header, err error)
- type EmptyTokenError
- type ResponseError
- type StatusError
- type WrongTokenError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { BuildURL func(string, string) string // contains filtered or unexported fields }
Client is HTTP client accessing to the Qiita API v2.
func (*Client) DebugMode ¶
DebugMode sets debugMode to Client. When debugMode is true, qiitactl outputs the logs (e.g., HTTP request and response).
func (Client) Delete ¶
func (c Client) Delete(subDomain string, path string, data interface{}) (body []byte, header http.Header, err error)
Delete send DELETE request with data body to the URL built with subDomain and path.
func (Client) Get ¶
func (c Client) Get(subDomain string, path string, v *url.Values) (body []byte, header http.Header, err error)
Get send GET request to the URL built with subDomain and path.
func (Client) Options ¶
func (c Client) Options(subDomain string, path string, data interface{}) (body []byte, header http.Header, err error)
Options send OPTIONS request with data body to the URL built with subDomain and path.
type EmptyTokenError ¶
type EmptyTokenError struct{}
EmptyTokenError occurs when request is sent without token.
func (EmptyTokenError) Error ¶
func (err EmptyTokenError) Error() (msg string)
type ResponseError ¶
ResponseError occurs when the response status is failed and the body is JSON.
func (ResponseError) Error ¶
func (err ResponseError) Error() (msg string)
type StatusError ¶
StatusError occurs when the response status is failed and the body isn't JSON.
func (StatusError) Error ¶
func (err StatusError) Error() (msg string)
type WrongTokenError ¶
type WrongTokenError struct{}
WrongTokenError occurs when the sent token is invalid.
func (WrongTokenError) Error ¶
func (err WrongTokenError) Error() (msg string)