handlertest

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGoroutineAwareTestReporter added in v1.1.0

func NewGoroutineAwareTestReporter(t gomock.TestReporter) gomock.TestReporter

NewGoroutineAwareTestReporter returns a test reporter that is safe to call in different goroutine. The returned test reporter does not fail immediately in fatal condition, but will panic instead.

Types

type FuncProcessor

type FuncProcessor struct {
	Mockfunc func(*router.Payload)
}

func (FuncProcessor) Preprocess

func (p FuncProcessor) Preprocess(payload *router.Payload, _ *router.Response) int

type MockGateway

type MockGateway router.Gateway

func NewMockGateway

func NewMockGateway(pattern string, path string, methods []string, handler router.Handler, prepareFunc func(*router.Payload)) *MockGateway

func (*MockGateway) Request

func (g *MockGateway) Request(method string, body string) *httptest.ResponseRecorder

type SingleRouteRouter

type SingleRouteRouter router.Router

SingleRouteRouter is a router that only serves with a single handler, regardless of the requested action.

func NewSingleRouteRouter

func NewSingleRouteRouter(handler router.Handler, prepareFunc func(*router.Payload)) *SingleRouteRouter

NewSingleRouteRouter creates a SingleRouteRouter, mapping the specified handler as the only route.

func (*SingleRouteRouter) POST

POST invoke the only route mapped on the SingleRouteRouter.

type SingleUserAuthProvider

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

SingleUserAuthProvider is an AuthProvider that only authenticates a single user if the auth data provided contains the required principal name.

func NewSingleUserAuthProvider

func NewSingleUserAuthProvider(providerName string, principalName string) *SingleUserAuthProvider

NewSingleUserAuthProvider creates a new instance of SingleUserAuthProvider.

func (*SingleUserAuthProvider) Info

func (p *SingleUserAuthProvider) Info(ctx context.Context, authData map[string]interface{}) (newAuthData map[string]interface{}, err error)

Info implements the AuthProvider's Info interface.

func (*SingleUserAuthProvider) Login

func (p *SingleUserAuthProvider) Login(ctx context.Context, authData map[string]interface{}) (principalID string, newAuthData map[string]interface{}, err error)

Login implements the AuthProvider's Login interface.

func (*SingleUserAuthProvider) Logout

func (p *SingleUserAuthProvider) Logout(ctx context.Context, authData map[string]interface{}) (newAuthData map[string]interface{}, err error)

Logout implements the AuthProvider's Logout interface.

Jump to

Keyboard shortcuts

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