Documentation
¶
Overview ¶
Package wrapped provides a structure and functions for containing and processing wrapped responses and errors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertGenericError ¶
func AssertGenericError(t *testing.T, r WrappedReply)
AssertGenericError checks that an error response body has the required fields populated
func AssertGenericReply ¶
func AssertGenericReply(t *testing.T, r WrappedReply)
AssertGenericReply checks that an response body has the required fields populated for a generic reply.
func AssertWrappedReply ¶
func AssertWrappedReply(t *testing.T, r WrappedReply)
AssertWrappedReply checks that a wrapped response body has the required fields populated
Types ¶
type WrappedReply ¶
type WrappedReply struct { Message string `json:"message"` Self string `json:"self"` Data interface{} `json:"data,omitempty"` }
A WrappedReply represents the response that should be returned when the client has requested data be wrapped and meta information included or when error information is being returned
func DecodeFromReader ¶
func DecodeFromReader(r io.Reader) (WrappedReply, error)
DecodeFromReader decodes JSON from a Reader into a WrappedReply
Click to show internal directories.
Click to hide internal directories.