mock

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllMocks

func GetAllMocks(ctx context.Context, req *proto.GetMockReq) ([]*proto.Mock, error)

func GetHttpHeader

func GetHttpHeader(m map[string]*proto.StrArr) map[string][]string

func GetProtoMap

func GetProtoMap(m map[string][]string) map[string]*proto.StrArr

func NewContext

func NewContext(conf Config) context.Context

func PostHttpMock added in v0.5.3

func PostHttpMock(ctx context.Context, path string, mock *proto.Mock) bool

func StartRecordingMocks added in v0.5.3

func StartRecordingMocks(ctx context.Context, path, mode, name string, overWrite bool) bool

Types

type Config

type Config struct {
	Mode      keploy.Mode // Default: test
	Name      string      // Default: Auto generated during record mode and required in test mode
	CTX       context.Context
	Path      string // Default: ./mocks
	OverWrite bool
	Remove    []string          // removes given http fields from yaml. Format: "<req_OR_resp_OR_all>.<header_OR_body>.<FIELD_NAME>"
	Replace   map[string]string // replaces values of given http fields. Format: key (can be "header.<KEY>", "domain", "method", "proto_major", "proto_minor")
}

Jump to

Keyboard shortcuts

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