mock

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 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       // Keploy mode on which unit test will run. Possible values: MODE_TEST or MODE_RECORD. Default: MODE_TEST
	Name      string            // Unique names for testcases of a unit test. If it is empty then, a unique id is generated by keploy during RECORD.
	CTX       context.Context   // Context in which KeployContext will be stored. If it is nil, then KeployContext is stored in context.Background.
	Path      string            // Path in which Keploy "/mocks" will be generated. Default: current working directroy.
	OverWrite bool              // OverWrite is used to compare new outputs of external calls with previously recorded outputs during record.
	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