Documentation ¶
Index ¶
- Constants
- func ApiGetJson(url string, reply interface{}) error
- func ApiPostJson(url string, args interface{}) error
- func ApiPutJson(url string, args, reply interface{}) error
- func ApiResponseError(err error) (int, string)
- func ApiResponseJson(v interface{}) (int, string)
- func EncodeURL(host string, format string, args ...interface{}) string
- func NewToken(segs ...string) string
- func NewXAuth(segs ...string) string
- type ApiRes
- type RemoteError
Constants ¶
View Source
const ( MethodGet = "GET" MethodPut = "PUT" MethodPost = "POST" )
Variables ¶
This section is empty.
Functions ¶
func ApiGetJson ¶
func ApiPostJson ¶
func ApiPutJson ¶
func ApiResponseError ¶
func ApiResponseJson ¶
Types ¶
type ApiRes ¶
type ApiRes struct { Status int `json:"status"` ErrMsg *RemoteError `json:"errmsg"` Data interface{} `json:"data"` }
func NewApiResByData ¶
func NewApiResByData(status int, data interface{}, errmsg *RemoteError) *ApiRes
type RemoteError ¶
func NewRemoteError ¶
func NewRemoteError(err error) *RemoteError
func (*RemoteError) Error ¶
func (e *RemoteError) Error() string
func (*RemoteError) TracedError ¶
func (e *RemoteError) TracedError() error
Click to show internal directories.
Click to hide internal directories.