Documentation
¶
Index ¶
- type CLICommandResult
- type CLICommandTest
- type CLIData
- type CLIStepCLICommand
- type CLIStepHTTPRequest
- type CLIStepResult
- type HTTPRequestResponseVariable
- type HTTPRequestResult
- type HTTPRequestTest
- type HTTPRequestTestHeader
- type HTTPRequestTestJSONValue
- type Lesson
- type LessonDataCLI
- type LoginRequest
- type LoginResponse
- type OperatorType
- type StructuredErrCLI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLICommandResult ¶ added in v1.3.0
type CLICommandTest ¶ added in v1.15.1
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 []CLICommandTest }
type CLIStepHTTPRequest ¶ added in v1.15.0
type CLIStepHTTPRequest struct { ResponseVariables []HTTPRequestResponseVariable Tests []HTTPRequestTest 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 HTTPRequestResponseVariable ¶ added in v1.15.1
type HTTPRequestResult ¶ added in v1.15.0
type HTTPRequestTest ¶ added in v1.15.1
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 ¶ added in v1.15.1
type HTTPRequestTestJSONValue ¶ added in v1.15.1
type HTTPRequestTestJSONValue struct { Path string Operator OperatorType IntValue *int StringValue *string BoolValue *bool }
type Lesson ¶ added in v1.4.0
type Lesson struct { Lesson struct { Type string LessonDataCLI *LessonDataCLI } }
func FetchLesson ¶ added in v1.4.0
type LessonDataCLI ¶ added in v1.15.0
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 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)
Click to show internal directories.
Click to hide internal directories.