config

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Scheduler scheduler.IScheduler `json:"scheduler"`

	// CustomLoggers list of custom loggers.
	CustomLoggers []*logger.Logger `json:"-"`
	// contains filtered or unexported fields
}

Config setup and scenario to execute

func NewEmptyConfig

func NewEmptyConfig() (*Config, error)

NewEmptyConfig creates an empty config

func NewExampleConfig

func NewExampleConfig() (*Config, error)

NewExampleConfig creates an example configuration populated with example data

func (*Config) Execute

func (cfg *Config) Execute(ctx context.Context, templateData interface{}) error

Execute scenario (will be replaced by scheduler)

func (*Config) SetDebugLogging

func (cfg *Config) SetDebugLogging()

SetDebugLogging override function to set debug logging

func (*Config) SetTrafficLogging

func (cfg *Config) SetTrafficLogging()

SetTrafficLogging override function to set traffic logging

func (*Config) SetTrafficMetricsLogging

func (cfg *Config) SetTrafficMetricsLogging()

SetTrafficMetricsLogging override function to set traffic logging

func (*Config) TestConnection

func (cfg *Config) TestConnection(ctx context.Context) error

func (*Config) UnmarshalJSON

func (cfg *Config) UnmarshalJSON(arg []byte) error

UnmarshalJSON unmarshal config

func (*Config) Validate

func (cfg *Config) Validate() error

Validate scenario

type LogFormatType

type LogFormatType int

LogFormatType one of: LogFormatTSVFile, LogFormatTSVConsole,

LogFormatJSONFile, LogFormatJSONConsole, LogFormatColorConsole
const (
	// LogFormatTSVFile log to tsv file, and status to console
	LogFormatTSVFile LogFormatType = iota
	// LogFormatTSVConsole log tsv to console and no status output
	LogFormatTSVConsole
	// LogFormatJSONFile log to json file, and status to console
	LogFormatJSONFile
	// LogFormatJSONConsole log json to console and no status output
	LogFormatJSONConsole
	// LogFormatColorConsole log to console color formatted and no status output
	LogFormatColorConsole
	// LogFormatTSVFileJSONConsole log to  console in json format and to file in TSV format
	LogFormatTSVFileJSONConsole
	// LogFormatNoLogs turns off all default logging, custom loggers will still be used
	LogFormatNoLogs
	// LogFormatOnlyStatus turns off all default logging except status, custom loggers will still be used
	LogFormatOnlyStatus
)

LogFormat enum

func (LogFormatType) GetEnumMap

func (value LogFormatType) GetEnumMap() *enummap.EnumMap

func (LogFormatType) MarshalJSON

func (format LogFormatType) MarshalJSON() ([]byte, error)

MarshalJSON marshal LogFormatType

func (*LogFormatType) UnmarshalJSON

func (format *LogFormatType) UnmarshalJSON(arg []byte) error

UnmarshalJSON unmarshal LogFormatType

type LogSettings

type LogSettings struct {
	Traffic        bool                   `json:"traffic,omitempty" displayname:"Traffic log" doc-key:"config.settings.logs.traffic"`
	Debug          bool                   `json:"debug,omitempty" displayname:"Debug log" doc-key:"config.settings.logs.debug"`
	TrafficMetrics bool                   `json:"metrics,omitempty" displayname:"Traffic metrics log" doc-key:"config.settings.logs.metrics"`
	FileName       session.SyncedTemplate `json:"filename" displayname:"Log filename" displayelement:"savefile" doc-key:"config.settings.logs.filename"`
	Format         LogFormatType          `json:"format,omitempty" displayname:"Log format" doc-key:"config.settings.logs.format"`
	Summary        SummaryType            `json:"summary,omitempty" displayname:"Summary type" doc-key:"config.settings.logs.summary"`
}

LogSettings settings for logging

type OutputsSettings

type OutputsSettings struct {
	Dir string `json:"dir" displayname:"Output directory" doc-key:"config.settings.outputs.dir"`
}

OutputsSettings settings for produced outputs (if any)

type Settings

type Settings struct {
	Timeout         int             `json:"timeout" displayname:"WebSocket timeout" doc-key:"config.settings.timeout"` // Timeout in seconds
	LogSettings     LogSettings     `json:"logs" doc-key:"config.settings.logs"`
	OutputsSettings OutputsSettings `json:"outputs,omitempty" doc-key:"config.settings.outputs"`
}

Settings Config settings struct

type SummaryActionDataEntry

type SummaryActionDataEntry struct {
	Action      string
	Label       string
	AppGUID     string
	SuccessRate string
	AvgResp     string
	Requests    string
	Errs        string
	Warns       string
	Sent        string
	Received    string
}

SummaryActionDataEntry data entry for action summary table

type SummaryEntry

type SummaryEntry struct {
	Value string
	Color string
	// contains filtered or unexported fields
}

SummaryEntry title, value and color combo for summary printout

func (*SummaryEntry) Title

func (entry *SummaryEntry) Title(summary SummaryType) string

Title returns long or short form of title depending on summary type

func (*SummaryEntry) ValueString

func (entry *SummaryEntry) ValueString(summary SummaryType) string

ValueString returns value string as ": value" or "<value>" depending on summary type

type SummaryHeader

type SummaryHeader map[string]*SummaryHeaderEntry

func (SummaryHeader) Col

func (header SummaryHeader) Col(key string, tbl *tabular.Table)

Col sets column in table from header entry

func (SummaryHeader) ColRJ

func (header SummaryHeader) ColRJ(key string, tbl *tabular.Table)

ColRJ sets column (Right Justified) in table from header entry

type SummaryHeaderEntry

type SummaryHeaderEntry struct {
	FullName string
	ColSize  int
}

SummaryHeaderEntry is used to calculate summary column sizes

func (*SummaryHeaderEntry) UpdateColSize

func (entry *SummaryHeaderEntry) UpdateColSize(new int)

UpdateColSize for summary header entry

type SummaryRequestDataEntry

type SummaryRequestDataEntry struct {
	Method   string
	Path     string
	AvgResp  string
	Requests string
	Sent     string
	Received string
}

SummaryRequestDataEntry data entry for request summary table

type SummaryType

type SummaryType int
const (
	SummaryTypeDefault SummaryType = iota
	SummaryTypeNone
	SummaryTypeSimple
	SummaryTypeExtended
	SummaryTypeFull
)

SummaryType enum

func (*SummaryType) EntryEnd

func (summary *SummaryType) EntryEnd() string

EntryEnd returns new row or space depending on summary type

func (SummaryType) GetEnumMap

func (value SummaryType) GetEnumMap() *enummap.EnumMap

func (SummaryType) MarshalJSON

func (value SummaryType) MarshalJSON() ([]byte, error)

MarshalJSON marshal LogFormatType

func (*SummaryType) UnmarshalJSON

func (value *SummaryType) UnmarshalJSON(arg []byte) error

UnmarshalJSON unmarshal LogFormatType

Jump to

Keyboard shortcuts

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