Documentation
¶
Index ¶
- Constants
- type CLICommandJqOutput
- type CLICommandResult
- type CLICommandTest
- type CLIData
- type CLIStep
- type CLIStepCLICommand
- type CLIStepHTTPRequest
- type CLIStepResult
- type HTTPBasicAuth
- type HTTPRequest
- type HTTPRequestResponseVariable
- type HTTPRequestResult
- type HTTPRequestTest
- type HTTPRequestTestHeader
- type HTTPRequestTestJSONValue
- type JqExpectedResult
- type JqOperator
- type JqValueType
- type Lesson
- type LessonDataCLI
- type LoginRequest
- type LoginResponse
- type OperatorType
- type Sleepable
- type StdoutJqTest
- type VerificationResultStructuredErrCLI
Constants ¶
View Source
const BaseURLOverrideRequired = "override"
View Source
const BaseURLPlaceholder = "${baseURL}"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLICommandJqOutput ¶
type CLICommandResult ¶
type CLICommandTest ¶
type CLICommandTest struct {
ExitCode *int
StdoutContainsAll []string
StdoutContainsNone []string
StdoutLinesGt *int
StdoutJq *StdoutJqTest
}
type CLIStep ¶
type CLIStep struct {
CLICommand *CLIStepCLICommand
HTTPRequest *CLIStepHTTPRequest
}
type CLIStepCLICommand ¶
type CLIStepCLICommand struct {
Command string
Tests []CLICommandTest
SleepAfterMs *int
StdoutFilterTmdl *string
}
func (*CLIStepCLICommand) GetSleepAfterMs ¶
func (c *CLIStepCLICommand) GetSleepAfterMs() *int
type CLIStepHTTPRequest ¶
type CLIStepHTTPRequest struct {
ResponseVariables []HTTPRequestResponseVariable
Tests []HTTPRequestTest
Request HTTPRequest
SleepAfterMs *int
}
func (*CLIStepHTTPRequest) GetSleepAfterMs ¶
func (h *CLIStepHTTPRequest) GetSleepAfterMs() *int
type CLIStepResult ¶
type CLIStepResult struct {
CLICommandResult *CLICommandResult
HTTPRequestResult *HTTPRequestResult
}
type HTTPBasicAuth ¶
type HTTPRequest ¶
type HTTPRequestResult ¶
type HTTPRequestTest ¶
type HTTPRequestTest struct {
StatusCode *int
BodyContains *string
BodyContainsNone *string
HeadersContain *HTTPRequestTestHeader
TrailersContain *HTTPRequestTestHeader
JSONValue *HTTPRequestTestJSONValue
}
Only one of these fields should be set
type HTTPRequestTestHeader ¶
type HTTPRequestTestJSONValue ¶
type HTTPRequestTestJSONValue struct {
Path string
Operator OperatorType
IntValue *int
StringValue *string
BoolValue *bool
}
type JqExpectedResult ¶
type JqExpectedResult struct {
Type JqValueType
Operator JqOperator
Value any
}
type JqOperator ¶
type JqOperator string // defined fully on backend
type JqValueType ¶
type JqValueType string
const ( JqTypeString JqValueType = "string" JqTypeInt JqValueType = "int" JqTypeBool JqValueType = "bool" )
type Lesson ¶
type Lesson struct {
Lesson struct {
Type string
LessonDataCLI *LessonDataCLI
}
}
func FetchLesson ¶
type LessonDataCLI ¶
type LessonDataCLI struct {
// Readme string
CLIData CLIData
}
type LoginRequest ¶
type LoginRequest struct {
Otp string `json:"otp"`
}
type LoginResponse ¶
type LoginResponse struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
}
func FetchAccessToken ¶
func FetchAccessToken() (*LoginResponse, error)
func LoginWithCode ¶
func LoginWithCode(code string) (*LoginResponse, error)
type OperatorType ¶
type OperatorType string
const ( OpEquals OperatorType = "eq" OpGreaterThan OperatorType = "gt" OpContains OperatorType = "contains" OpNotContains OperatorType = "not_contains" )
type StdoutJqTest ¶
type StdoutJqTest struct {
InputMode string // "json" or "jsonl"
Query string
ExpectedResults []JqExpectedResult
}
type VerificationResultStructuredErrCLI ¶
type VerificationResultStructuredErrCLI struct {
ErrorMessage string `json:"Error"`
FailedStepIndex int `json:"FailedStepIndex"`
FailedTestIndex int `json:"FailedTestIndex"`
}
func SubmitCLILesson ¶
func SubmitCLILesson(uuid string, results []CLIStepResult) (*VerificationResultStructuredErrCLI, error)
Click to show internal directories.
Click to hide internal directories.