context

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2016 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONResponse

type JSONResponse struct {
	Data   interface{}      `json:"data,omitempty"`
	Errors []*service.Error `json:"errors,omitempty"`
	Meta   *Meta            `json:"meta,omitempty"`
}

type Meta

type Meta struct {
	Trace *Trace `json:"trace,omitempty"`
}

type Standard

type Standard struct {
	// contains filtered or unexported fields
}

func NewStandard

func NewStandard(response rest.ResponseWriter, request *rest.Request) (*Standard, error)

func (*Standard) Logger

func (s *Standard) Logger() log.Logger

func (*Standard) Request

func (s *Standard) Request() *rest.Request

func (*Standard) RespondWithError

func (s *Standard) RespondWithError(err *service.Error)

func (*Standard) RespondWithInternalServerFailure

func (s *Standard) RespondWithInternalServerFailure(message string, failure ...interface{})

func (*Standard) RespondWithStatusAndData added in v0.1.0

func (s *Standard) RespondWithStatusAndData(statusCode int, data interface{})

func (*Standard) RespondWithStatusAndErrors

func (s *Standard) RespondWithStatusAndErrors(statusCode int, errors []*service.Error)

func (*Standard) Response

func (s *Standard) Response() rest.ResponseWriter

type Trace

type Trace struct {
	Request string `json:"request,omitempty"`
	Session string `json:"session,omitempty"`
}

Jump to

Keyboard shortcuts

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