req

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2017 License: MIT Imports: 10 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 struct {
	ID            string
	LoggerContext logrus.Fields
	AuthToken     *auth.Token

	RawRequest  *http.Request
	RawResponse http.ResponseWriter
}

func (*Request) ReadPayload

func (r *Request) ReadPayload(data interface{}) error

func (*Request) WritePayload

func (r *Request) WritePayload(data interface{}) error

type RouteHandler

type RouteHandler interface {
	Route() string
	Execute(Request) error
	IsAuthorized(*http.Request, *auth.Token) (bool, error)
}

type RouteHandlerFunc

type RouteHandlerFunc struct {
	Path        string
	Func        http.HandlerFunc
	Requirement filter.Requirement
}

func (RouteHandlerFunc) Execute

func (h RouteHandlerFunc) Execute(request Request) error

func (RouteHandlerFunc) IsAuthorized

func (h RouteHandlerFunc) IsAuthorized(r *http.Request, token *auth.Token) (bool, error)

func (RouteHandlerFunc) Route

func (h RouteHandlerFunc) Route() string

type WithAuthenticationRequired

type WithAuthenticationRequired struct{}

func (WithAuthenticationRequired) IsAuthorized

func (WithAuthenticationRequired) IsAuthorized(r *http.Request, token *auth.Token) (bool, error)

type WithoutAdditionalAuthorization

type WithoutAdditionalAuthorization struct{}

func (WithoutAdditionalAuthorization) IsAuthorized

func (WithoutAdditionalAuthorization) IsAuthorized(r *http.Request, token *auth.Token) (bool, error)

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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