Versions in this module Expand all Collapse all v1 v1.0.1 Oct 13, 2023 Changes in this version + const CallsNoConstraint + type Definition struct + func NewDefinition(path string, constraints []verifier, strategy ReplyStrategy, ...) *Definition + func (d *Definition) EndRunningContext() []error + func (d *Definition) Execute(w http.ResponseWriter, r *http.Request) []error + func (d *Definition) ExecuteWithoutVerifying(w http.ResponseWriter, r *http.Request) []error + func (d *Definition) ResetRunningContext() + type Error struct + ServiceName string + func (e *Error) Error() string + type Loader struct + func NewLoader(mocks *Mocks) *Loader + func (l *Loader) Load(mocksDefinition map[string]interface{}) error + type Mocks struct + func New(mocks ...*ServiceMock) *Mocks + func NewNop(serviceNames ...string) *Mocks + func (m *Mocks) EndRunningContext() []error + func (m *Mocks) GetNames() []string + func (m *Mocks) ResetDefinitions() + func (m *Mocks) ResetRunningContext() + func (m *Mocks) Service(serviceName string) *ServiceMock + func (m *Mocks) SetMock(mock *ServiceMock) + func (m *Mocks) Shutdown() + func (m *Mocks) ShutdownContext(ctx context.Context) error + func (m *Mocks) Start() error + type ReplyStrategy interface + HandleRequest func(w http.ResponseWriter, r *http.Request) []error + func NewConstantReplyWithCode(content []byte, statusCode int, headers map[string]string) ReplyStrategy + func NewDropRequestReply() ReplyStrategy + func NewFileReplyWithCode(filename string, statusCode int, headers map[string]string) (ReplyStrategy, error) + func NewMethodVaryReply(variants map[string]*Definition) ReplyStrategy + func NewSequentialReply(strategies []*Definition) ReplyStrategy + func NewUriVaryReply(basePath string, variants map[string]*Definition) ReplyStrategy + type RequestConstraintError struct + Constraint verifier + RequestDump []byte + func (e *RequestConstraintError) Error() string + type ServiceMock struct + ServiceName string + func NewServiceMock(serviceName string, mock *Definition) *ServiceMock + func (m *ServiceMock) EndRunningContext() []error + func (m *ServiceMock) ResetDefinition() + func (m *ServiceMock) ResetRunningContext() + func (m *ServiceMock) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (m *ServiceMock) ServerAddr() string + func (m *ServiceMock) SetDefinition(newDefinition *Definition) + func (m *ServiceMock) ShutdownServer(ctx context.Context) error + func (m *ServiceMock) StartServer() error + func (m *ServiceMock) StartServerWithAddr(addr string) error