request

package
v0.0.0-...-6907ca9 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request interface {
	String() string

	// Logger returns the logger used by the request
	Logger() logger.Logger

	// Reporter returns the reporter used by the request
	Reporter() reporter.Reporter

	// Signature returns the signature of the request
	// Ex. POST /users
	Signature() string

	// ID returns the ID of the request
	ID() string

	// Response returns the response of the request
	Response() Response

	// Params returns the params needed by the endpoint
	Params() interface{}

	// User returns the user that made the request
	User() *auth.User

	// SetUser sets the user object that made the request
	SetUser(*auth.User)

	// Session returns the session used to make the request
	Session() *auth.Session

	// SetSession sets the session object that was used to make the request
	SetSession(*auth.Session)

	// Context returns the context of the request
	Context() context.Context
}

Request represents an http request

type Response

type Response interface {
	// Header returns the header map that will be attached to the response
	Header() http.Header

	// NoContent sends a response with no content
	NoContent()

	// Created sends a response with a newly created entity attached
	Created(obj interface{}) error

	// Created sends response with a JSON object attached
	Ok(obj interface{}) error
}

Response represents the response of a request

Directories

Path Synopsis
Package mockrequest is a generated GoMock package.
Package mockrequest is a generated GoMock package.

Jump to

Keyboard shortcuts

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