mocks

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	ServiceName string
	// contains filtered or unexported fields
}

func (*Error) Error

func (e *Error) Error() string

type Loader

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

func NewLoader

func NewLoader(mocks *Mocks) *Loader

func (*Loader) Load

func (l *Loader) Load(mocksDefinition map[string]interface{}) error

type Mocks

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

func New

func New(mocks ...*ServiceMock) *Mocks

func NewNop

func NewNop(serviceNames ...string) *Mocks

func (*Mocks) EndRunningContext

func (m *Mocks) EndRunningContext() []error

func (*Mocks) ResetDefinitions

func (m *Mocks) ResetDefinitions()

func (*Mocks) ResetRunningContext

func (m *Mocks) ResetRunningContext()

func (*Mocks) Service

func (m *Mocks) Service(serviceName string) *ServiceMock

func (*Mocks) Shutdown

func (m *Mocks) Shutdown()

func (*Mocks) Start

func (m *Mocks) Start() error

type RequestConstraintError

type RequestConstraintError struct {
	Constraint verifier
	Request    *http.Request
	// contains filtered or unexported fields
}

func (*RequestConstraintError) Error

func (e *RequestConstraintError) Error() string

type ServiceMock

type ServiceMock struct {
	sync.Mutex

	ServiceName string
	// contains filtered or unexported fields
}

func NewServiceMock

func NewServiceMock(serviceName string, mock *definition) *ServiceMock

func (*ServiceMock) EndRunningContext

func (m *ServiceMock) EndRunningContext() []error

func (*ServiceMock) ResetDefinition

func (m *ServiceMock) ResetDefinition()

func (*ServiceMock) ResetRunningContext

func (m *ServiceMock) ResetRunningContext()

func (*ServiceMock) ServeHTTP

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

func (*ServiceMock) ServerAddr

func (m *ServiceMock) ServerAddr() string

func (*ServiceMock) SetDefinition

func (m *ServiceMock) SetDefinition(newDefinition *definition)

func (*ServiceMock) ShutdownServer

func (m *ServiceMock) ShutdownServer()

func (*ServiceMock) StartServer

func (m *ServiceMock) StartServer() error

Jump to

Keyboard shortcuts

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