Documentation ¶
Index ¶
- Constants
- func BindJSON(w http.ResponseWriter, r *http.Request, v interface{}) error
- func SendJSON(status int, w http.ResponseWriter, r *http.Request, v interface{}) error
- type RESTClient
- func (c *RESTClient) AppendUserAgent(userAgent string) *RESTClient
- func (c *RESTClient) Delete(path string, request interface{}, response interface{}, successCode int) (int, error)
- func (c *RESTClient) Get(path string, response interface{}) (int, error)
- func (c *RESTClient) Post(path string, request interface{}, response interface{}, successCode int) (int, error)
- func (c *RESTClient) Put(path string, request interface{}, response interface{}, successCode int) (int, error)
- func (c *RESTClient) SendData(method string, path string, request interface{}, response interface{}, ...) (int, error)
- func (c *RESTClient) SetAuthToken(token string) *RESTClient
- func (c *RESTClient) SetBaseUrl(baseURL string) *RESTClient
- func (c *RESTClient) SetContentType(contentType string) *RESTClient
- func (c *RESTClient) SetTokenKey(key string) *RESTClient
- func (c *RESTClient) SetTokenValue(value string) *RESTClient
- func (c *RESTClient) SetUserAgent(userAgent string) *RESTClient
- func (c *RESTClient) UseSessionCookie(useCookie bool) *RESTClient
Constants ¶
View Source
const ( ContentTypeJSON = "application/json" ContentTypeMsgPack = "application/msgpack" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RESTClient ¶
func (*RESTClient) AppendUserAgent ¶ added in v0.9.0
func (c *RESTClient) AppendUserAgent(userAgent string) *RESTClient
func (*RESTClient) Delete ¶
func (c *RESTClient) Delete(path string, request interface{}, response interface{}, successCode int) (int, error)
func (*RESTClient) Post ¶
func (c *RESTClient) Post(path string, request interface{}, response interface{}, successCode int) (int, error)
func (*RESTClient) Put ¶
func (c *RESTClient) Put(path string, request interface{}, response interface{}, successCode int) (int, error)
func (*RESTClient) SetAuthToken ¶
func (c *RESTClient) SetAuthToken(token string) *RESTClient
func (*RESTClient) SetBaseUrl ¶ added in v0.9.0
func (c *RESTClient) SetBaseUrl(baseURL string) *RESTClient
func (*RESTClient) SetContentType ¶ added in v0.10.0
func (c *RESTClient) SetContentType(contentType string) *RESTClient
func (*RESTClient) SetTokenKey ¶
func (c *RESTClient) SetTokenKey(key string) *RESTClient
func (*RESTClient) SetTokenValue ¶
func (c *RESTClient) SetTokenValue(value string) *RESTClient
func (*RESTClient) SetUserAgent ¶ added in v0.9.0
func (c *RESTClient) SetUserAgent(userAgent string) *RESTClient
func (*RESTClient) UseSessionCookie ¶ added in v0.9.0
func (c *RESTClient) UseSessionCookie(useCookie bool) *RESTClient
Click to show internal directories.
Click to hide internal directories.