context

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2018 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context added in v1.20.0

type Context struct {
	*Responder
}

func New added in v1.20.0

func New(res rest.ResponseWriter, req *rest.Request) (*Context, error)

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 Responder added in v1.20.0

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

func NewResponder added in v1.20.0

func NewResponder(response rest.ResponseWriter, request *rest.Request) (*Responder, error)

func (*Responder) Logger added in v1.20.0

func (r *Responder) Logger() log.Logger

func (*Responder) Request added in v1.20.0

func (r *Responder) Request() *rest.Request

func (*Responder) RespondWithError added in v1.20.0

func (r *Responder) RespondWithError(err *service.Error)

func (*Responder) RespondWithInternalServerFailure added in v1.20.0

func (r *Responder) RespondWithInternalServerFailure(message string, failure ...interface{})

func (*Responder) RespondWithStatusAndData added in v1.20.0

func (r *Responder) RespondWithStatusAndData(statusCode int, data interface{})

func (*Responder) RespondWithStatusAndErrors added in v1.20.0

func (r *Responder) RespondWithStatusAndErrors(statusCode int, errors []*service.Error)

func (*Responder) Response added in v1.20.0

func (r *Responder) 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