Documentation ¶
Index ¶
- func GetBagEntry[T any](bag ReportBag, entry ReportBagEntry, defaultVal T) T
- type AssertInvocation
- type ExecRequestInvocation
- type ExecutionLog
- type ExecutionLogRecord
- type Invocation
- type InvocationState
- type InvocationType
- type Printer
- type RattContext
- type RattModel
- type ReportBag
- type ReportBagEntry
- type Reporter
- type RequestDeclaration
- type RequestDeclarationArg
- type RequestDeclarationHeader
- type RequestExecutionResult
- type RequestInvocation
- type RequestInvocationArg
- type ScriptDeclaration
- type ScriptExecutionResult
- type ScriptInvocation
- type SetInvocation
- type TestCaseInvocation
- type VarDeclaration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBagEntry ¶
func GetBagEntry[T any](bag ReportBag, entry ReportBagEntry, defaultVal T) T
Types ¶
type AssertInvocation ¶
type AssertInvocation interface { Invocation Expression() *hcl.Attribute }
type ExecRequestInvocation ¶
type ExecRequestInvocation interface { Invocation ExecWithResult(ctx RattContext) *RequestExecutionResult }
type ExecutionLog ¶
type ExecutionLog struct { Root *ExecutionLogRecord All []*ExecutionLogRecord Head *ExecutionLogRecord }
func NewExecutionLog ¶
func NewExecutionLog() *ExecutionLog
func (*ExecutionLog) Add ¶
func (l *ExecutionLog) Add(iv Invocation, state InvocationState, bag ReportBag)
type ExecutionLogRecord ¶
type ExecutionLogRecord struct { Id string State InvocationState Type InvocationType Bag ReportBag Name string DefRange *hcl.Range Children []*ExecutionLogRecord }
type Invocation ¶
type Invocation interface { Name() string Type() InvocationType DefRange() *hcl.Range Exec(ctx RattContext) }
type InvocationState ¶
type InvocationState = string
const ( BeginState InvocationState = "BeginState" RunningState InvocationState = "RunningState" EndState InvocationState = "EndState" FailedState InvocationState = "FailedState" )
type InvocationType ¶
type InvocationType = string
const ( ForEachStepInvocationType InvocationType = "foreachStep" ForEachInvocationType InvocationType = "foreach" TestcaseInvocationType InvocationType = "testcase" RequestInvocationType InvocationType = "request" ScriptInvocationType InvocationType = "script" AssertInvocationType InvocationType = "assert" SetInvocationType InvocationType = "set" )
type Printer ¶
type Printer interface { Print(log *ExecutionLog, ctx RattContext) Flush(log *ExecutionLog, ctx RattContext) }
type RattContext ¶
type RattModel ¶
type RattModel interface { Vars() []VarDeclaration Requests() []RequestDeclaration Scripts() []ScriptDeclaration Invocations() []Invocation Run() Exec(name string, args map[string]string) *RequestExecutionResult MustNoErrors() // edit endpoints UpsertVar(file string, address string, value string) }
type ReportBag ¶
type ReportBag = map[ReportBagEntry]interface{}
type ReportBagEntry ¶
type ReportBagEntry = string
const ( IdBagEntry ReportBagEntry = "id" ItemsLengthBagEntry ReportBagEntry = "itemsLength" ExpressionBagEntry ReportBagEntry = "expression" DurationBagEntry ReportBagEntry = "duration" SetValueBagEntry ReportBagEntry = "setValue" StatusCodeBagEntry ReportBagEntry = "statusCode" StatusTextBagEntry ReportBagEntry = "statusText" ResponseBodyAsStringBagEntry ReportBagEntry = "responseBodyAsString" )
type Reporter ¶
type Reporter interface { HasErrors() bool Error(msg string) Reporter ErrorWithRange(msg string, r *hcl.Range) Reporter AddDiags(diags hcl.Diagnostics) Reporter Invocation(iv Invocation, state InvocationState, ctx RattContext) Reporter GetDiagnostics() hcl.Diagnostics Flush(ctx RattContext) Reporter }
type RequestDeclaration ¶
type RequestDeclaration interface { GetMethod(ctx RattContext) string GetUrl(ctx RattContext) string GetContentType(ctx RattContext) (string, bool) GetBody(ctx RattContext) ([]byte, bool) GetArgs() []RequestDeclarationArg GetName() string DefRange() *hcl.Range GetHeaders() []RequestDeclarationHeader }
type RequestDeclarationArg ¶
type RequestDeclarationArg interface { Name() string ReadModel() *hcl.Attribute }
type RequestDeclarationHeader ¶
type RequestDeclarationHeader interface { Name(ctx RattContext) string Value(ctx RattContext) string ReadModel() *hcl.BodyContent }
type RequestExecutionResult ¶
type RequestInvocation ¶
type RequestInvocation interface { Invocation }
type RequestInvocationArg ¶
type RequestInvocationArg interface { Name() string DefRange() *hcl.Range ReadModel() *hcl.Attribute }
type ScriptDeclaration ¶
type ScriptDeclaration interface { GetName() string DefRange() *hcl.Range Lang(ctx RattContext) string Content(ctx RattContext) string }
type ScriptExecutionResult ¶
type ScriptInvocation ¶
type ScriptInvocation interface { Invocation }
type SetInvocation ¶
type SetInvocation interface { Invocation Expression() *hcl.Attribute }
type TestCaseInvocation ¶
type TestCaseInvocation interface { Invocation }
type VarDeclaration ¶
type VarDeclaration interface { ReadModel() *hcl.Attribute Invocation }
Click to show internal directories.
Click to hide internal directories.