yaml

package
v0.0.0-...-ed06964 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(in File) ([]byte, error)

Types

type File

type File struct {
	Type FileType `yaml:"type"`
	Spec any      `yaml:"spec"`
}

func Decode

func Decode(contents []byte) (File, error)

func (File) Encode

func (f File) Encode() ([]byte, error)

func (File) Test

func (f File) Test() (Test, error)

func (File) TestSuite

func (f File) TestSuite() (TestSuite, error)

func (File) Validate

func (f File) Validate() error

type FileType

type FileType string
const (
	FileTypeTest           FileType = "Test"
	FileTypeTestSuite      FileType = "TestSuite"
	FileTypeEnvironment    FileType = "Environment"
	FileTypeDataStore      FileType = "DataStore"
	FileTypeConfig         FileType = "Config"
	FileTypeDemo           FileType = "Demo"
	FileTypePollingProfile FileType = "PollingProfile"
	FileTypeAnalyzer       FileType = "Analyzer"
)

func (FileType) String

func (ft FileType) String() string

type GRPC

type GRPC struct {
	ProtobufFile string             `yaml:"protobufFile"`
	Address      string             `yaml:"address"`
	Method       string             `yaml:"method"`
	Metadata     []GRPCHeader       `yaml:"metadata,omitempty"`
	Auth         HTTPAuthentication `yaml:"authentication,omitempty"`
	Request      string             `yaml:"request,omitempty"`
}

func (GRPC) Validate

func (r GRPC) Validate() error

type GRPCHeader

type GRPCHeader struct {
	Key   string `yaml:"key"`
	Value string `yaml:"value"`
}

func (GRPCHeader) Validate

func (h GRPCHeader) Validate() error

type HTTPAPIKeyAuth

type HTTPAPIKeyAuth struct {
	Key   string `yaml:"key"`
	Value string `yaml:"value"`
	In    string `yaml:"in"`
}

func (HTTPAPIKeyAuth) Validate

func (aka HTTPAPIKeyAuth) Validate() error

type HTTPAuthentication

type HTTPAuthentication struct {
	Type   string          `yaml:"type,omitempty"`
	Basic  *HTTPBasicAuth  `yaml:"basic,omitempty"`
	APIKey *HTTPAPIKeyAuth `yaml:"apiKey,omitempty"`
	Bearer *HTTPBearerAuth `yaml:"bearer,omitempty"`
}

func (HTTPAuthentication) Validate

func (a HTTPAuthentication) Validate() error

type HTTPBasicAuth

type HTTPBasicAuth struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

func (HTTPBasicAuth) Validate

func (ba HTTPBasicAuth) Validate() error

type HTTPBearerAuth

type HTTPBearerAuth struct {
	Token string `yaml:"token" dc:"bearer"`
}

func (HTTPBearerAuth) Validate

func (ba HTTPBearerAuth) Validate() error

type HTTPHeader

type HTTPHeader struct {
	Key   string `yaml:"key"`
	Value string `yaml:"value"`
}

func (HTTPHeader) Validate

func (h HTTPHeader) Validate() error

type HTTPRequest

type HTTPRequest struct {
	URL             string              `yaml:"url"`
	Method          string              `yaml:"method"`
	Headers         []HTTPHeader        `yaml:"headers,omitempty" dc:"headers"`
	Authentication  *HTTPAuthentication `yaml:"authentication,omitempty" dc:"auth"`
	Body            string              `yaml:"body,omitempty"`
	SSLVerification bool                `yaml:"sslVerification,omitempty"`
}

func (HTTPRequest) Validate

func (r HTTPRequest) Validate() error

type Output

type Output struct {
	Name     string `mapstructure:"name"`
	Selector string `mapstructure:"selector"`
	Value    string `mapstructure:"value"`
}

type Outputs

type Outputs []Output

func (Outputs) Model

func (outs Outputs) Model() test.Outputs

type TRACEIDRequest

type TRACEIDRequest struct {
	ID string `yaml:"id"`
}

func (TRACEIDRequest) Validate

func (t TRACEIDRequest) Validate() error

type Test

type Test struct {
	ID          string      `mapstructure:"id"`
	Name        string      `mapstructure:"name"`
	Description string      `mapstructure:"description" yaml:",omitempty"`
	Trigger     TestTrigger `mapstructure:"trigger"`
	Specs       TestSpecs   `mapstructure:"specs" yaml:",omitempty"`
	Outputs     Outputs     `mapstructure:"outputs,omitempty" yaml:",omitempty"`
}

func (Test) Model

func (t Test) Model() test.Test

func (Test) Validate

func (t Test) Validate() error

type TestSpec

type TestSpec struct {
	Name       string   `mapstructure:"name" yaml:",omitempty"`
	Selector   string   `mapstructure:"selector"`
	Assertions []string `mapstructure:"assertions"`
}

type TestSpecs

type TestSpecs []TestSpec

func (TestSpecs) Model

func (ts TestSpecs) Model() test.Specs

type TestSuite

type TestSuite struct {
	ID          string            `mapstructure:"id"`
	Name        string            `mapstructure:"name"`
	Description string            `mapstructure:"description" yaml:",omitempty"`
	Env         map[string]string `mapstructure:"env" yaml:",omitempty"`
	Steps       []string          `mapstructure:"steps"`
}

func (TestSuite) Model

func (t TestSuite) Model() testsuite.TestSuite

func (TestSuite) Validate

func (t TestSuite) Validate() error

type TestTrigger

type TestTrigger struct {
	Type        string         `mapstructure:"type"`
	HTTPRequest HTTPRequest    `mapstructure:"httpRequest" yaml:"httpRequest,omitempty" dc:"http"`
	GRPC        GRPC           `mapstructure:"grpc" yaml:"grpc,omitempty"`
	TRACEID     TRACEIDRequest `mapstructure:"traceid" yaml:"traceid,omitempty"`
}

func (TestTrigger) Validate

func (t TestTrigger) Validate() error

Jump to

Keyboard shortcuts

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