authtest

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2016 License: LGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerMock

type HandlerMock struct {
	mock.Mock
}

HandlerMock implements http.Handler and is intended for use in tests.

func (HandlerMock) ServeHTTP

func (m HandlerMock) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is needed to conform http.Handler interface and responds with HTTP 200 and an empty body.

type StaticTokenSource

type StaticTokenSource string

StaticTokenSource implements auth.TokenGenerator and always returns itself as a token.

func (StaticTokenSource) Generate

func (src StaticTokenSource) Generate(tokenLen int) string

Generate is needed to conform auth.TokenGenerator interface and returns StaticTokenSource as a string ignoring provided token length.

type TokenAuthenticatorMock

type TokenAuthenticatorMock struct {
	mock.Mock
}

TokenAuthenticatorMock imprements auth.TokenAuthenticator and is intended for using in tests.

func (TokenAuthenticatorMock) Authenticate

func (m TokenAuthenticatorMock) Authenticate(token string) bool

Authenticate is needed to conform auth.TokenAuthenticator interface and returns mocked value.

type TokenSourceMock

type TokenSourceMock struct {
	mock.Mock
}

TokenSourceMock implements auth.TokenGenerator and is intended for using in tests.

func (*TokenSourceMock) Generate

func (src *TokenSourceMock) Generate(tokenLen int) string

Generate is needed to conform auth.TokenGenerator interface and returns mocked value.

Jump to

Keyboard shortcuts

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