Documentation ¶
Index ¶
- Constants
- type AppStructureReport
- type AppStructureWarning
- type Appstructure
- type Config
- func (cfg *Config) Execute(ctx context.Context, templateData interface{}) error
- func (cfg *Config) GetAppStructures(ctx context.Context, includeRaw bool) error
- func (cfg *Config) GetAppStructuresAndWarnings(ctx context.Context, includeRaw bool) ([]*Appstructure, error)
- func (cfg *Config) PopulateHookData()
- func (cfg *Config) SetDebugLogging()
- func (cfg *Config) SetRegressionLogging()
- func (cfg *Config) SetTrafficLogging()
- func (cfg *Config) SetTrafficMetricsLogging()
- func (cfg *Config) SetupStatistics(summary SummaryType) error
- func (cfg *Config) TestConnection(ctx context.Context) error
- func (cfg *Config) UnmarshalJSON(arg []byte) error
- func (cfg *Config) Validate() error
- type Extractor
- type FailLevel
- type GeneratedAppStructure
- func (structure *GeneratedAppStructure) AddBookmark(bookmark appstructure.AppStructureBookmark)
- func (structure *GeneratedAppStructure) AddObject(obj appstructure.AppStructureObject)
- func (structure *GeneratedAppStructure) AddStoryObject(object appstructure.AppStructureStoryObject)
- func (structure *GeneratedAppStructure) GetWarningsList() []AppStructureWarning
- type GetAppStructureSettings
- type Hook
- func (hook *Hook) Execute(ctx context.Context, logEntry *logger.LogEntry, data *hookData, ...) error
- func (hook *Hook) ExtractAndValidateData(source []byte, data *hookData, logEntry *logger.LogEntry) error
- func (hook *Hook) OkResponse(respCode int) bool
- func (hook *Hook) UnmarshalJSON(arg []byte) error
- func (hook *Hook) Validate() ([]string, error)
- type HookCore
- type HookHeader
- type Hooks
- type HttpMethod
- type LogFormatType
- type LogSettings
- type OutputsSettings
- type Settings
- type SummaryActionDataEntry
- type SummaryEntry
- type SummaryHeader
- type SummaryHeaderEntry
- type SummaryRequestDataEntry
- type SummaryType
- type ValidationType
- type Validator
- type ValidatorCore
Constants ¶
const ( AppStructureWarningObjectNotExists = "ObjectNotExists" AppStructureWarningMasterObjectNotExists = "MasterObjectNotExists" AppStructureWarningUnsupportedVisualization = "UnsupportedVisualization" AppStructureWarningMissingDimMeasure = "MissingDimMeasure" AppStructureWarningMeasureNotFound = "MeasureNotFound" AppStructureWarningMetaInformationNotFound = "MetaInformationNotFound" AppStructureWarningDimensionNotFound = "DimensionNotFound" AppStructureWarningPropertiesError = "PropertiesError" AppStructureWarningChildError = "ChildError" AppStructureWarningSnapshotError = "SnapshotError" )
const DefaultSummaryFilename = "summary.json"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppStructureReport ¶ added in v0.5.2
type AppStructureReport struct {
// contains filtered or unexported fields
}
AppStructureReport reports warnings and fetched objects for app structure
func (*AppStructureReport) AddWarning ¶ added in v0.5.2
func (report *AppStructureReport) AddWarning(warning AppStructureWarning)
AddWarning to app structure report
type AppStructureWarning ¶ added in v0.17.3
type AppStructureWarning struct { ObjectID string ObjectType string ObjectVisualization string Warningtype string Message string }
func (AppStructureWarning) String ¶ added in v0.17.3
func (warning AppStructureWarning) String() string
String implements Stringer interface
type Appstructure ¶ added in v0.17.3
type Appstructure struct { Guid string Warnings []AppStructureWarning Structure *appstructure.AppStructure }
Appstructure and warnings in consumable form
type Config ¶
type Config struct { Scheduler scheduler.IScheduler `json:"scheduler"` // CustomLoggers list of custom loggers. CustomLoggers []*logger.Logger `json:"-"` // Counters statistics for execution Counters statistics.ExecutionCounters `json:"-"` // ValidationWarnings list of script validation warnings ValidationWarnings []string `json:"-"` // Options alter the behavior of unmarshal and validate Options struct { // AcceptNoScheduler produces no error scheduler does not exist in json AcceptNoScheduler bool } `json:"-"` // Cancel execution, should be set to function triggering context cancel Cancel func(msg string) `json:"-"` // contains filtered or unexported fields }
Config setup and scenario to execute
func NewExampleConfig ¶
NewExampleConfig creates an example configuration populated with example data
func (*Config) GetAppStructures ¶ added in v0.5.2
GetAppStructures for all apps in scenario
func (*Config) GetAppStructuresAndWarnings ¶ added in v0.17.3
func (*Config) PopulateHookData ¶ added in v0.11.5
func (cfg *Config) PopulateHookData()
func (*Config) SetDebugLogging ¶
func (cfg *Config) SetDebugLogging()
SetDebugLogging override function to set debug logging
func (*Config) SetRegressionLogging ¶ added in v0.10.0
func (cfg *Config) SetRegressionLogging()
SetRegressionLogging override function to set regression 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) SetupStatistics ¶ added in v0.5.4
func (cfg *Config) SetupStatistics(summary SummaryType) error
func (*Config) UnmarshalJSON ¶
UnmarshalJSON unmarshal Config. Only unmarshals scheduler if scheduler is nil.
type Extractor ¶ added in v0.11.5
type Extractor struct { Name string `Json:"name" doc-key:"hook.extractor.name" displayname:"Name"` Path helpers.DataPath `json:"path" doc-key:"hook.extractor.path" displayname:"Path"` Level FailLevel `json:"faillevel" doc-key:"hook.extractor.faillevel" displayname:"Fail level"` Validator *Validator `json:"validator" doc-key:"hook.extractor.validator" displayname:"Validator"` }
type FailLevel ¶ added in v0.11.5
type FailLevel int
func (FailLevel) GetEnumMap ¶ added in v0.11.5
GetEnumMap of FailLevel for GUI
func (FailLevel) MarshalJSON ¶ added in v0.11.5
MarshalJSON marshal ValidationType
func (*FailLevel) UnmarshalJSON ¶ added in v0.11.5
UnmarshalJSON FailLevel
type GeneratedAppStructure ¶ added in v0.5.2
type GeneratedAppStructure struct { appstructure.AppStructure // contains filtered or unexported fields }
GeneratedAppStructure of Sense app
func (*GeneratedAppStructure) AddBookmark ¶ added in v0.5.2
func (structure *GeneratedAppStructure) AddBookmark(bookmark appstructure.AppStructureBookmark)
AddBookmark to structure
func (*GeneratedAppStructure) AddObject ¶ added in v0.5.2
func (structure *GeneratedAppStructure) AddObject(obj appstructure.AppStructureObject)
AddObject to structure
func (*GeneratedAppStructure) AddStoryObject ¶ added in v0.6.3
func (structure *GeneratedAppStructure) AddStoryObject(object appstructure.AppStructureStoryObject)
AddStoryObject to structure
func (*GeneratedAppStructure) GetWarningsList ¶ added in v0.17.8
func (structure *GeneratedAppStructure) GetWarningsList() []AppStructureWarning
type GetAppStructureSettings ¶ added in v0.17.8
type GetAppStructureSettings struct { IncludeRaw bool `json:"includeRaw,omitempty"` // TruncateStringsTo truncates non significant strings to size if set to > 0 TruncateStringsTo int `json:"truncate,omitempty"` AppStructures map[string]*GeneratedAppStructure }
func (*GetAppStructureSettings) Execute ¶ added in v0.17.8
func (settings *GetAppStructureSettings) Execute(sessionState *session.State, actionState *action.State, connectionSettings *connection.ConnectionSettings, label string, reset func())
Execute implements ActionSettings interface
func (*GetAppStructureSettings) Validate ¶ added in v0.17.8
func (settings *GetAppStructureSettings) Validate() ([]string, error)
Validate implements ActionSettings interface
type Hook ¶ added in v0.11.5
type Hook struct {
HookCore
}
func (*Hook) Execute ¶ added in v0.11.5
func (hook *Hook) Execute(ctx context.Context, logEntry *logger.LogEntry, data *hookData, allowUntrusted bool) error
Execute hook
func (*Hook) ExtractAndValidateData ¶ added in v0.11.5
func (hook *Hook) ExtractAndValidateData(source []byte, data *hookData, logEntry *logger.LogEntry) error
ExtractAndValidateData
func (*Hook) OkResponse ¶ added in v0.11.5
OkResponse checks if response is listed response code
func (*Hook) UnmarshalJSON ¶ added in v0.11.5
UnmarshalJSON(arg []byte) error {
type HookCore ¶ added in v0.11.5
type HookCore struct { Url string `json:"url" doc-key:"hook.url" displayname:"Url"` Method HttpMethod `json:"method" doc-key:"hook.method" displayname:"Method"` Content synced.Template `json:"payload" doc-key:"hook.content" displayname:"Content" displayelement:"textarea"` RespCodes []int `json:"respcodes" doc-key:"hook.respcodes" displayname:"Response codes"` ContentType string `json:"contenttype" doc-key:"hook.contenttype" displayname:"Content-Type"` Extractors []Extractor `json:"extractors" doc-key:"hook.extractors" displayname:"Extractors"` Headers []HookHeader `json:"headers" doc-key:"hook.headers" displayname:"Headers"` // contains filtered or unexported fields }
type HookHeader ¶ added in v0.11.5
type Hooks ¶ added in v0.11.5
type HttpMethod ¶ added in v0.11.5
type HttpMethod int
const ( MethodNone HttpMethod = iota MethodGet MethodHead MethodPost MethodPut MethodPatch MethodDelete MethodConnect MethodOptions MethodTrace )
func (HttpMethod) GetEnumMap ¶ added in v0.11.5
func (method HttpMethod) GetEnumMap() *enummap.EnumMap
GetEnumMap of HttpMethod for GUI
func (HttpMethod) MarshalJSON ¶ added in v0.11.5
func (method HttpMethod) MarshalJSON() ([]byte, error)
MarshalJSON marshal HttpMethod
func (*HttpMethod) UnmarshalJSON ¶ added in v0.11.5
func (method *HttpMethod) UnmarshalJSON(arg []byte) error
UnmarshalJSON HttpMethod
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"` Regression bool `json:"regression,omitempty" displayname:"Regression log" doc-key:"config.settings.logs.regression"` FileName synced.Template `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"` SummaryFileName string `json:"summaryFilename,omitempty" displayname:"Name of summary file" doc-key:"config.settings.logs.summaryfile"` }
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:"Request 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"` MaxErrorCount uint64 `json:"maxerrors,omitempty" doc-key:"config.settings.maxerrors" displayname:"Max errors"` }
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 { LongTitle string `json:"longTitle"` // used in extended and full summary ShortTitle string `json:"shortTitle"` // used in simple summary Value string `json:"value"` Color string `json:"-"` }
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
type SummaryHeaderEntry ¶
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 SummaryTypeFile )
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
type ValidationType ¶ added in v0.11.5
type ValidationType int
const ( ValidationTypeNone ValidationType = iota ValidationTypeBool ValidationTypeNumber ValidationTypeString )
ValidationType
func (ValidationType) GetEnumMap ¶ added in v0.11.5
func (val ValidationType) GetEnumMap() *enummap.EnumMap
GetEnumMap of ValidationType for GUI
func (ValidationType) MarshalJSON ¶ added in v0.11.5
func (typ ValidationType) MarshalJSON() ([]byte, error)
MarshalJSON marshal ValidationType
func (*ValidationType) UnmarshalJSON ¶ added in v0.11.5
func (typ *ValidationType) UnmarshalJSON(arg []byte) error
UnmarshalJSON ValidationType
type Validator ¶ added in v0.11.5
type Validator struct {
ValidatorCore
}
func (*Validator) UnmarshalJSON ¶ added in v0.11.5
UnmarshalJSON Validator
func (*Validator) ValidateValue ¶ added in v0.11.5
Validate validation rule
type ValidatorCore ¶ added in v0.11.5
type ValidatorCore struct { Type ValidationType `json:"type" doc-key:"hook.extractor.validator.type" displayname:"Type"` Value string `json:"value" doc-key:"hook.extractor.validator.value" displayname:"Value"` // contains filtered or unexported fields }