mocks

package
v0.0.0-...-216dd6c Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiHandlerMock

type ApiHandlerMock struct {
	ServeHTTPCall struct {
		Receives struct {
			Res http.ResponseWriter
			Req *http.Request
		}
	}
}

func (ApiHandlerMock) ServeHTTP

func (api ApiHandlerMock) ServeHTTP(res http.ResponseWriter, req *http.Request)

type ContextProviderMock

type ContextProviderMock struct {
}

Stupid minimal mock needed to fulfill a contract

func (ContextProviderMock) ContextFromRequest

func (c ContextProviderMock) ContextFromRequest(req *http.Request) context.Context

type LoggerMock

type LoggerMock struct {
}

Stupid minimal mock needed to fulfill a contract

func (*LoggerMock) Debugf

func (*LoggerMock) Debugf(ctx context.Context, format string, v ...interface{})

func (*LoggerMock) Errorf

func (*LoggerMock) Errorf(ctx context.Context, format string, v ...interface{})

func (*LoggerMock) Infof

func (*LoggerMock) Infof(ctx context.Context, format string, v ...interface{})

type TokenExtractor

type TokenExtractor struct {
	ExtractTokenCall struct {
		Returns struct {
			Token *gitkit.Token
			Error error
		}
	}
}

func (*TokenExtractor) ExtractToken

func (t *TokenExtractor) ExtractToken(req *http.Request, ctx context.Context, audience []string) (*gitkit.Token, error)

I do not care about the input

type UserStore

type UserStore struct {
	Store struct {
		Users []gitserver.User
	}

	UpdateUserCall struct {
		Receives struct {
			Ctx  context.Context
			User *gitserver.User
		}
		Returns struct {
			Err error
		}
	}

	LookupUserCall struct {
		Receives struct {
			Ctx context.Context
			ID  string
		}
		Returns struct {
			Err error
		}
	}
}

func (*UserStore) LookupUser

func (us *UserStore) LookupUser(ctx context.Context, id string) (*gitserver.User, error)

func (*UserStore) UpdateUser

func (us *UserStore) UpdateUser(ctx context.Context, user *gitserver.User) error

Jump to

Keyboard shortcuts

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