Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIVersion ¶
APIVersion retrieves the api version from the context.
func DataRender ¶
DataRender creates an OK Payload for the given data
func ErrRender ¶
ErrRender creates an Error Payload with the given OCS error code and message The httpcode will be determined using the API version stored in the context
func OcsV1StatusCodes ¶
OcsV1StatusCodes returns the http status codes for the OCS API v1.
func OcsV2StatusCodes ¶
OcsV2StatusCodes maps the OCS codes to http status codes for the ocs API v2. see https://github.com/owncloud/core/blob/c08baf580927ecb8ec179028dda255fdd85b4568/lib/private/legacy/api.php#L528 also HTTP status codes for apps are the same as OCS codes see https://github.com/owncloud/core/blob/b9ff4c93e051c94adfb301545098ae627e52ef76/lib/public/AppFramework/OCSController.php#L142-L150 I think this is a bug in the ocs v2 api, but since we are going to mimic bugs in ocis ... here goes
Types ¶
type Payload ¶
type Payload struct { Meta data.Meta `json:"meta" xml:"meta"` Data interface{} `json:"data,omitempty" xml:"data,omitempty"` }
Payload combines response metadata and data
type Response ¶
type Response struct {
OCS *Payload `json:"ocs" xml:"ocs"`
}
Response is the top level response structure
func (Response) MarshalXML ¶
MarshalXML handles ocs specific wrapping of array members in 'element' tags for the data