Documentation
¶
Index ¶
- type CLICommandResult
- type CLICommandTestCase
- type CLIData
- type CLIStepCLICommand
- type CLIStepHTTPRequest
- type CLIStepResult
- type HTTPRequestResult
- type HTTPTest
- type HTTPTestHeader
- type HTTPTestJSONValue
- type HTTPTestValidationError
- type Lesson
- type LessonDataCLI
- type LessonDataCLICommand
- type LessonDataHTTPTests
- type LessonDataHTTPTestsRequest
- type LoginRequest
- type LoginResponse
- type OperatorType
- type ResponseVariable
- type StructuredErrCLI
- type StructuredErrCLICommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLICommandResult ¶ added in v1.3.0
type CLICommandTestCase ¶ added in v1.3.0
type CLIData ¶ added in v1.15.0
type CLIData struct {
// ContainsCompleteDir bool
BaseURL *string
Steps []struct {
CLICommand *CLIStepCLICommand
HTTPRequest *CLIStepHTTPRequest
}
}
type CLIStepCLICommand ¶ added in v1.15.0
type CLIStepCLICommand struct {
Command string
Tests []CLICommandTestCase
}
type CLIStepHTTPRequest ¶ added in v1.15.0
type CLIStepHTTPRequest struct {
ResponseVariables []ResponseVariable
Tests []HTTPTest
Request struct {
Method string
Path string
FullURL string // overrides BaseURL and Path if set
Headers map[string]string
BodyJSON map[string]interface{}
BasicAuth *struct {
Username string
Password string
}
Actions struct {
DelayRequestByMs *int32
}
}
}
type CLIStepResult ¶ added in v1.15.0
type CLIStepResult struct {
CLICommandResult *CLICommandResult
HTTPRequestResult *HTTPRequestResult
}
type HTTPRequestResult ¶ added in v1.15.0
type HTTPTest ¶
type HTTPTest struct {
StatusCode *int
BodyContains *string
BodyContainsNone *string
HeadersContain *HTTPTestHeader
JSONValue *HTTPTestJSONValue
}
Only one of these fields should be set
type HTTPTestHeader ¶
type HTTPTestJSONValue ¶
type HTTPTestJSONValue struct {
Path string
Operator OperatorType
IntValue *int
StringValue *string
BoolValue *bool
}
type HTTPTestValidationError ¶
type HTTPTestValidationError struct {
ErrorMessage *string `json:"Error"`
FailedRequestIndex *int `json:"FailedRequestIndex"`
FailedTestIndex *int `json:"FailedTestIndex"`
}
func SubmitHTTPTestLesson ¶ added in v1.4.0
func SubmitHTTPTestLesson(uuid string, results any) (*HTTPTestValidationError, error)
type Lesson ¶ added in v1.4.0
type Lesson struct {
Lesson struct {
Type string
LessonDataHTTPTests *LessonDataHTTPTests
LessonDataCLICommand *LessonDataCLICommand
LessonDataCLI *LessonDataCLI
}
}
func FetchLesson ¶ added in v1.4.0
type LessonDataCLI ¶ added in v1.15.0
type LessonDataCLI struct {
// Readme string
CLIData CLIData
}
type LessonDataCLICommand ¶ added in v1.4.0
type LessonDataCLICommand struct {
CLICommandData struct {
Commands []struct {
Command string
Tests []CLICommandTestCase
}
}
}
type LessonDataHTTPTests ¶ added in v1.4.0
type LessonDataHTTPTests struct {
HttpTests struct {
BaseURL *string
ContainsCompleteDir bool
Requests []LessonDataHTTPTestsRequest
}
}
type LessonDataHTTPTestsRequest ¶ added in v1.13.2
type LessonDataHTTPTestsRequest struct {
ResponseVariables []ResponseVariable
Tests []HTTPTest
Request struct {
FullURL string // overrides BaseURL and Path if set
Path string
BasicAuth *struct {
Username string
Password string
}
Headers map[string]string
BodyJSON map[string]interface{}
Method string
Actions struct {
DelayRequestByMs *int32
}
}
}
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 ResponseVariable ¶
type StructuredErrCLI ¶ added in v1.15.0
type StructuredErrCLI struct {
ErrorMessage string `json:"Error"`
FailedStepIndex int `json:"FailedStepIndex"`
FailedTestIndex int `json:"FailedTestIndex"`
}
func SubmitCLILesson ¶ added in v1.15.0
func SubmitCLILesson(uuid string, results []CLIStepResult) (*StructuredErrCLI, error)
type StructuredErrCLICommand ¶ added in v1.3.0
type StructuredErrCLICommand struct {
ErrorMessage string `json:"Error"`
FailedCommandIndex int `json:"FailedCommandIndex"`
FailedTestIndex int `json:"FailedTestIndex"`
}
func SubmitCLICommandLesson ¶ added in v1.4.0
func SubmitCLICommandLesson(uuid string, results []CLICommandResult) (*StructuredErrCLICommand, error)
Click to show internal directories.
Click to hide internal directories.