Documentation ¶
Index ¶
- Variables
- func AddHttpBodyToMap(body string, m map[string][]string) error
- func CompareHeaders(h1 http.Header, h2 http.Header, res *[]models.HeaderResult, ...) bool
- func Contains(elems []string, v string) bool
- func Decode(yamlTestcase *NetworkTrafficDoc, logger *zap.Logger) (*models.TestCase, error)
- func FindNoisyFields(m map[string][]string, comparator func(string, []string) bool) []string
- func Flatten(j interface{}) map[string][]string
- func FlattenHttpResponse(h http.Header, body string) (map[string][]string, error)
- func NewSessionIndex(path string, Logger *zap.Logger) (string, error)
- func ReadSessionIndices(path string, Logger *zap.Logger) ([]string, error)
- type NetworkTrafficDoc
- type TestReport
- func (fe *TestReport) GetResults(runId string) ([]platform.KindSpecifier, error)
- func (fe *TestReport) Lock()
- func (fe *TestReport) Read(ctx context.Context, path, name string) (platform.KindSpecifier, error)
- func (fe *TestReport) SetResult(runId string, test platform.KindSpecifier)
- func (fe *TestReport) Unlock()
- func (fe *TestReport) Write(ctx context.Context, path string, doc platform.KindSpecifier) error
- type Yaml
- func (ys *Yaml) DeleteTest(mock *models.Mock, ctx context.Context) error
- func (ys *Yaml) ReadConfigMocks(path string) ([]platform.KindSpecifier, error)
- func (ys *Yaml) ReadTcsMocks(tcRead platform.KindSpecifier, path string) ([]platform.KindSpecifier, error)
- func (ys *Yaml) ReadTestcase(path string, lastSeenId platform.KindSpecifier, options platform.KindSpecifier) ([]platform.KindSpecifier, error)
- func (ys *Yaml) UpdateTest(mock *models.Mock, ctx context.Context) error
- func (ys *Yaml) Write(path, fileName string, docRead platform.KindSpecifier) error
- func (ys *Yaml) WriteMock(mockRead platform.KindSpecifier, ctx context.Context) error
- func (ys *Yaml) WriteTestcase(tcRead platform.KindSpecifier, ctx context.Context, ...) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Emoji = "\U0001F430" + " Keploy:"
Functions ¶
func CompareHeaders ¶
func FindNoisyFields ¶
func Flatten ¶
Flatten takes a map and returns a new one where nested maps are replaced by dot-delimited keys. examples of valid jsons - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#examples
func FlattenHttpResponse ¶
Types ¶
type NetworkTrafficDoc ¶
type NetworkTrafficDoc struct { Version models.Version `json:"version" yaml:"version"` Kind models.Kind `json:"kind" yaml:"kind"` Name string `json:"name" yaml:"name"` Spec yamlLib.Node `json:"spec" yaml:"spec"` Curl string `json:"curl" yaml:"curl,omitempty"` }
NetworkTrafficDoc stores the request-response data of a network call (ingress or egress)
func EncodeMock ¶
func EncodeTestcase ¶
func (*NetworkTrafficDoc) GetKind ¶
func (nd *NetworkTrafficDoc) GetKind() string
type TestReport ¶
func NewTestReportFS ¶
func NewTestReportFS(logger *zap.Logger) *TestReport
func (*TestReport) GetResults ¶
func (fe *TestReport) GetResults(runId string) ([]platform.KindSpecifier, error)
func (*TestReport) Lock ¶
func (fe *TestReport) Lock()
func (*TestReport) Read ¶
func (fe *TestReport) Read(ctx context.Context, path, name string) (platform.KindSpecifier, error)
func (*TestReport) SetResult ¶
func (fe *TestReport) SetResult(runId string, test platform.KindSpecifier)
func (*TestReport) Unlock ¶
func (fe *TestReport) Unlock()
func (*TestReport) Write ¶
func (fe *TestReport) Write(ctx context.Context, path string, doc platform.KindSpecifier) error
type Yaml ¶
type Yaml struct { TcsPath string MockPath string MockName string TcsName string Logger *zap.Logger // contains filtered or unexported fields }
func NewYamlStore ¶
func (*Yaml) ReadConfigMocks ¶
func (ys *Yaml) ReadConfigMocks(path string) ([]platform.KindSpecifier, error)
func (*Yaml) ReadTcsMocks ¶
func (ys *Yaml) ReadTcsMocks(tcRead platform.KindSpecifier, path string) ([]platform.KindSpecifier, error)
func (*Yaml) ReadTestcase ¶
func (ys *Yaml) ReadTestcase(path string, lastSeenId platform.KindSpecifier, options platform.KindSpecifier) ([]platform.KindSpecifier, error)
func (*Yaml) Write ¶
func (ys *Yaml) Write(path, fileName string, docRead platform.KindSpecifier) error
write is used to generate the yaml file for the recorded calls and writes the yaml document.
func (*Yaml) WriteTestcase ¶
func (ys *Yaml) WriteTestcase(tcRead platform.KindSpecifier, ctx context.Context, filtersRead platform.KindSpecifier) error
Click to show internal directories.
Click to hide internal directories.