config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigTypeJson = "jsonReader"

Variables

View Source
var AvailableConfigReader = make(map[string]ConfigReader)

Functions

This section is empty.

Types

type ConfigReader

type ConfigReader interface {
	Init([]byte) error
	CreateHammer() (types.Hammer, error)
}

ConfigReader is the interface that abstracts different config reader implementations.

func NewConfigReader

func NewConfigReader(config []byte, configType string) (reader ConfigReader, err error)

NewConfigReader is the factory method of the ConfigReader.

type CookieConf added in v1.0.0

type CookieConf struct {
	Cookies []CustomCookie `json:"cookies"`
	Enabled bool           `json:"enabled"`
}

type CsvConf added in v0.12.0

type CsvConf struct {
	Path          string         `json:"path"`
	Delimiter     string         `json:"delimiter"`
	SkipFirstLine bool           `json:"skip_first_line"`
	Vars          map[string]Tag `json:"vars"` // "0":"name", "1":"city","2":"team"
	SkipEmptyLine bool           `json:"skip_empty_line"`
	AllowQuota    bool           `json:"allow_quota"`
	Order         string         `json:"order"`
}

func (*CsvConf) UnmarshalJSON added in v0.12.0

func (c *CsvConf) UnmarshalJSON(data []byte) error

type CustomCookie added in v1.0.0

type CustomCookie struct {
	Name     string `json:"name"`
	Value    string `json:"value"`
	Domain   string `json:"domain"`
	Path     string `json:"path"`
	Expires  string `json:"expires"`
	MaxAge   int    `json:"max_age"`
	HttpOnly bool   `json:"http_only"`
	Secure   bool   `json:"secure"`
	Raw      string `json:"raw"`
}

type JsonReader added in v0.2.0

type JsonReader struct {
	ReqCount     *int                   `json:"request_count"`
	IterCount    *int                   `json:"iteration_count"`
	LoadType     string                 `json:"load_type"`
	Duration     int                    `json:"duration"`
	Assertions   []TestAssertion        `json:"success_criterias"`
	TimeRunCount timeRunCount           `json:"manual_load"`
	Steps        []step                 `json:"steps"`
	Output       string                 `json:"output"`
	Proxy        string                 `json:"proxy"`
	Envs         map[string]interface{} `json:"env"`
	Data         map[string]CsvConf     `json:"data"`
	Debug        bool                   `json:"debug"`
	SamplingRate *int                   `json:"sampling_rate"`
	EngineMode   string                 `json:"engine_mode"`
	Cookies      CookieConf             `json:"cookie_jar"`
}

func (*JsonReader) CreateHammer added in v0.2.0

func (j *JsonReader) CreateHammer() (h types.Hammer, err error)

func (*JsonReader) Init added in v0.2.0

func (j *JsonReader) Init(jsonByte []byte) (err error)

func (*JsonReader) UnmarshalJSON added in v0.2.0

func (j *JsonReader) UnmarshalJSON(data []byte) error

type RegexCaptureConf added in v0.11.0

type RegexCaptureConf struct {
	Exp *string `json:"exp"`
	No  int     `json:"matchNo"`
}

type RemoteMultipartError added in v0.16.6

type RemoteMultipartError struct {
	// contains filtered or unexported fields
}

func (RemoteMultipartError) Error added in v0.16.6

func (nf RemoteMultipartError) Error() string

func (RemoteMultipartError) Unwrap added in v0.16.6

func (nf RemoteMultipartError) Unwrap() error

type Tag added in v0.12.0

type Tag struct {
	Tag  string `json:"tag"`
	Type string `json:"type"`
}

func (*Tag) UnmarshalJSON added in v0.12.0

func (t *Tag) UnmarshalJSON(data []byte) error

type TestAssertion added in v1.0.0

type TestAssertion struct {
	Rule  string `json:"rule"`
	Abort bool   `json:"abort"`
	Delay int    `json:"delay"`
}

Jump to

Keyboard shortcuts

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