mock

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERR_DEP_REQ_UNEQUAL_INSERT string = "the stored external dependency output is not for the current dependency request call. Insert the new mock"
	ERR_DEP_REQ_UNEQUAL_REMOVE string = "a set of dependency calls are removed. Remove the adjacent set of mocks from the mock file"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

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

Mock is a service to read-write mocks during record and replay in unit-tests only.

func NewMockService

func NewMockService(mockFS models.MockFS, log *zap.Logger) *Mock

func (*Mock) FileExists added in v0.5.2

func (m *Mock) FileExists(ctx context.Context, path string, overWrite bool) (bool, error)

func (*Mock) GetAll added in v0.5.0

func (m *Mock) GetAll(ctx context.Context, path string, name string) ([]models.Mock, error)

GetAll returns an array of mocks which are captured in unit-tests

func (*Mock) Put

func (m *Mock) Put(ctx context.Context, path string, doc *proto.Mock, meta interface{}, remove []string, replace map[string]string) error

type Service

type Service interface {
	Put(ctx context.Context, path string, doc *proto.Mock, meta interface{}, remove []string, replace map[string]string) error
	GetAll(ctx context.Context, path string, name string) ([]models.Mock, error)
	FileExists(ctx context.Context, path string, overWrite bool) (bool, error)
}

Jump to

Keyboard shortcuts

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