Version: v1.0.2 Latest Latest

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

Go to latest
Published: Jan 4, 2019 License: GPL-2.0 Imports: 12 Imported by: 0




This section is empty.


This section is empty.


func ShouldValidateRequest

func ShouldValidateRequest(t *testing.T, useCase domain.UseCase, request interface{})


type FakeRequest

type FakeRequest struct {
	Method  api.HTTPMethod
	Handler http.HandlerFunc
	Payload []byte
	URL     string

func (FakeRequest) Record

func (fakeReq FakeRequest) Record() *httptest.ResponseRecorder

type MockRouterRepository

type MockRouterRepository struct {
	OnGetAllResponse []domain.Router

func (*MockRouterRepository) DeleteWithName

func (m *MockRouterRepository) DeleteWithName(name string) error

func (*MockRouterRepository) ExistsWithName

func (m *MockRouterRepository) ExistsWithName(name string) bool

func (*MockRouterRepository) GetAll

func (m *MockRouterRepository) GetAll() []domain.Router

func (*MockRouterRepository) GetOneByName

func (m *MockRouterRepository) GetOneByName(name string) (domain.Router, error)

func (*MockRouterRepository) Save

func (m *MockRouterRepository) Save(router domain.Router) error

type StubCipher

type StubCipher struct {
	OnEncrypt string
	OnDecrypt string

func (StubCipher) Decrypt

func (s StubCipher) Decrypt(source []byte, key []byte) []byte

func (StubCipher) Encrypt

func (s StubCipher) Encrypt(source []byte, key []byte) []byte

type StubDriver

type StubDriver struct {
	ReturnName              string
	ReturnVersion           string
	ReturnExecuteError      percorsodrivers.DriverError
	ReturnAvailableCommands []percorsodrivers.CommandName
	ReturnExecutePayload    percorsodrivers.Payload
	ReturnAuthModes         []percorsodrivers.AuthMode
	PanicWhenExecute        bool

func (StubDriver) Execute

func (m StubDriver) Execute(command percorsodrivers.Command, config percorsodrivers.RouterConfig) (percorsodrivers.Payload, percorsodrivers.DriverError)

func (StubDriver) GetAuthModes

func (m StubDriver) GetAuthModes() []percorsodrivers.AuthMode

func (StubDriver) GetAvailableCommands

func (m StubDriver) GetAvailableCommands() []percorsodrivers.CommandName

func (StubDriver) Name

func (m StubDriver) Name() string

func (StubDriver) Version

func (m StubDriver) Version() string

type StubDriverStore

type StubDriverStore struct {
	OnGetDriverByNameResult domain.Driver
	OnGetDriverByNameError  error
	OnGetAllDrivers         []domain.Driver

func (StubDriverStore) GetAllDrivers

func (m StubDriverStore) GetAllDrivers() []domain.Driver

func (StubDriverStore) GetDriverByName

func (m StubDriverStore) GetDriverByName(name string) (domain.Driver, error)

type StubGoPlugin

type StubGoPlugin struct {
	LookupSymbol plugin.Symbol
	LookupError  error

func (StubGoPlugin) Lookup

func (m StubGoPlugin) Lookup(symbol string) (plugin.Symbol, error)

type StubPluginStore

type StubPluginStore struct {
	LoadError     error
	GetAllDrivers []drivers.GoPlugin

func (StubPluginStore) GetAll

func (m StubPluginStore) GetAll() []drivers.GoPlugin

func (StubPluginStore) Load

func (m StubPluginStore) Load() error

type StubPresenter

type StubPresenter struct {
	OnInformation func(info interface{})
	OnError       func(err domain.UseCaseError)

func (StubPresenter) PresentError

func (m StubPresenter) PresentError(err domain.UseCaseError)

func (StubPresenter) PresentInformation

func (m StubPresenter) PresentInformation(info interface{})

type StubRepositoryFactory

type StubRepositoryFactory struct {
	ReturnRepo interface{}

func (StubRepositoryFactory) GetRepositoryForName

func (rep StubRepositoryFactory) GetRepositoryForName(requestedName string) (interface{}, error)

func (StubRepositoryFactory) GetRepositoryForType

func (rep StubRepositoryFactory) GetRepositoryForType(requestedType interface{}) (interface{}, error)

Jump to

Keyboard shortcuts

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