yaml

package
v2.3.0-beta40 Latest Latest
Warning

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

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

Documentation

Overview

Package yaml provides utility functions for working with YAML files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareHeaders

func CompareHeaders(h1 http.Header, h2 http.Header, res *[]models.HeaderResult, noise map[string]string) bool

func Contains

func Contains(elems []string, v string) bool

func CopyDir

func CopyDir(srcDir, destDir string, rename bool, logger *zap.Logger) error

CopyDir recursively copies a directory tree, attempting to preserve permissions

func CopyFile

func CopyFile(src, dst string, rename bool, logger *zap.Logger) error

CopyFile copies a single file from src to dst

func CreateDir

func CreateDir(path string, logger *zap.Logger) error

CreateDir to create a directory if it doesn't exist

func CreateYamlFile

func CreateYamlFile(ctx context.Context, Logger *zap.Logger, path string, fileName string) (bool, error)

func DeleteDir

func DeleteDir(_ context.Context, logger *zap.Logger, path string) error

func DeleteFile

func DeleteFile(_ context.Context, logger *zap.Logger, path, name string) error

func FindLastIndex

func FindLastIndex(path string, _ *zap.Logger) (int, error)

FindLastIndex returns the index for the new yaml file by reading the yaml file names in the given path directory

func NewSessionIndex

func NewSessionIndex(path string, Logger *zap.Logger) (string, error)

func ReadDir

func ReadDir(path string, fileMode fs.FileMode) (*os.File, error)

func ReadFile

func ReadFile(ctx context.Context, logger *zap.Logger, path, name string) ([]byte, error)

func ReadSessionIndices

func ReadSessionIndices(_ context.Context, path string, Logger *zap.Logger) ([]string, error)

func ReadYAMLFile

func ReadYAMLFile(ctx context.Context, logger *zap.Logger, filePath string, fileName string, v interface{}, extType bool) error

ReadYAMLFile to read and parse YAML file

func ValidatePath

func ValidatePath(path string) (string, error)

func WriteFile

func WriteFile(ctx context.Context, logger *zap.Logger, path, fileName string, docData []byte, isAppend bool) error

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"`
	ConnectionID string         `json:"connectionId" yaml:"connectionId,omitempty"`
}

NetworkTrafficDoc stores the request-response data of a network call (ingress or egress)

Directories

Path Synopsis
configdb
testset
Package testset provides functionality for working with keploy testset level configs like templates, post/pre script.
Package testset provides functionality for working with keploy testset level configs like templates, post/pre script.
user
Package user provides functionality for working with keploy user configs like installation id.
Package user provides functionality for working with keploy user configs like installation id.
Package mockdb provides a mock database implementation.
Package mockdb provides a mock database implementation.
Package openapidb provides a openAPI database implementation.
Package openapidb provides a openAPI database implementation.
Package reportdb provides functionality for managing test reports in a database.
Package reportdb provides functionality for managing test reports in a database.
Package testdb provides functionality for working with test databases.
Package testdb provides functionality for working with test databases.

Jump to

Keyboard shortcuts

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