mockdb

package
v2.3.0-beta37 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package mockdb provides a mock database implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeMock

func EncodeMock(mock *models.Mock, logger *zap.Logger) (*yaml.NetworkTrafficDoc, error)

Types

type MockYaml

type MockYaml struct {
	MockPath string
	MockName string
	Logger   *zap.Logger
	// contains filtered or unexported fields
}

func New

func New(Logger *zap.Logger, mockPath string, mockName string) *MockYaml

func (*MockYaml) GetFilteredMocks

func (ys *MockYaml) GetFilteredMocks(ctx context.Context, testSetID string, afterTime time.Time, beforeTime time.Time) ([]*models.Mock, error)

func (*MockYaml) GetHTTPMocks

func (ys *MockYaml) GetHTTPMocks(ctx context.Context, testSetID string, mockPath string, mockFileName string) ([]*models.HTTPDoc, error)

func (*MockYaml) GetUnFilteredMocks

func (ys *MockYaml) GetUnFilteredMocks(ctx context.Context, testSetID string, afterTime time.Time, beforeTime time.Time) ([]*models.Mock, error)

func (*MockYaml) InsertMock

func (ys *MockYaml) InsertMock(ctx context.Context, mock *models.Mock, testSetID string) error

func (*MockYaml) UpdateMocks

func (ys *MockYaml) UpdateMocks(ctx context.Context, testSetID string, mockNames map[string]bool) error

UpdateMocks deletes the mocks from the mock file with given names

mockNames is a map which contains the name of the mocks as key and a isConfig boolean as value

Jump to

Keyboard shortcuts

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