Documentation
¶
Index ¶
- Variables
- func Auth(request *wedeploy.WeDeploy)
- func AuthGet(path string, data interface{}) error
- func DecodeJSON(request *wedeploy.WeDeploy, data interface{}) error
- func EncodeJSON(data interface{}) (*bytes.Reader, error)
- func ParamsFromJSON(request *wedeploy.WeDeploy, data interface{})
- func SetBody(request *wedeploy.WeDeploy, data interface{}) error
- func URL(paths ...string) *wedeploy.WeDeploy
- func Validate(request *wedeploy.WeDeploy, err error) error
- type APIFault
- type APIFaultError
- type APIFaultErrors
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidContentType is used when the content-type is not application/json ErrInvalidContentType = errors.New("Can only decode data for application/json") // ErrExtractingParams is used when query string params fail due to unrecognized type ErrExtractingParams = errors.New("Can only extract query string params from flat objects") )
View Source
var DefaultToken = "1"
DefaultToken for the API server
Functions ¶
func Auth ¶
func Auth(request *wedeploy.WeDeploy)
Auth a WeDeploy request with the global authentication data
func DecodeJSON ¶
func DecodeJSON(request *wedeploy.WeDeploy, data interface{}) error
DecodeJSON decodes a JSON response
func EncodeJSON ¶
EncodeJSON encodes a object using its JSON annotations map and creates a reader that can be used as body for requests, for example
func ParamsFromJSON ¶
func ParamsFromJSON(request *wedeploy.WeDeploy, data interface{})
ParamsFromJSON creates query string params from a flat object with JSON tags
Types ¶
type APIFault ¶
type APIFault struct {
Method string
URL string
Code int `json:"code"`
Message string `json:"message"`
Errors APIFaultErrors `json:"errors"`
}
APIFault is sent by the server when errors happen Method and URL MUST NOT have JSON tags
type APIFaultError ¶
APIFaultError is the error structure for the errors described by a fault
type APIFaultErrors ¶
type APIFaultErrors []APIFaultError
APIFaultErrors is the array of APIFaultError
Click to show internal directories.
Click to hide internal directories.