wrapped

package
v0.0.0-...-4670381 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2020 License: MIT Imports: 4 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL