api

package
v1.20.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const BaseURLOverrideRequired = "override"
View Source
const BaseURLPlaceholder = "${baseURL}"

Variables

This section is empty.

Functions

This section is empty.

Types

type CLICommandResult added in v1.3.0

type CLICommandResult struct {
	ExitCode     int
	FinalCommand string `json:"-"`
	Stdout       string
	Variables    map[string]string
}

type CLICommandTest added in v1.15.1

type CLICommandTest struct {
	ExitCode           *int
	StdoutContainsAll  []string
	StdoutContainsNone []string
	StdoutLinesGt      *int
}

type CLIData added in v1.15.0

type CLIData struct {
	// ContainsCompleteDir bool
	BaseURLDefault string
	Steps          []CLIStep
}

type CLIStep added in v1.18.0

type CLIStep 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           HTTPRequest
}

type CLIStepResult added in v1.15.0

type CLIStepResult struct {
	CLICommandResult  *CLICommandResult
	HTTPRequestResult *HTTPRequestResult
}

type HTTPActions added in v1.18.0

type HTTPActions struct {
	DelayRequestByMs *int
}

type HTTPBasicAuth added in v1.18.0

type HTTPBasicAuth struct {
	Username string
	Password string
}

type HTTPRequest added in v1.18.0

type HTTPRequest struct {
	Method   string
	FullURL  string
	Headers  map[string]string
	BodyJSON map[string]any

	BasicAuth *HTTPBasicAuth
	Actions   HTTPActions
}

type HTTPRequestResponseVariable added in v1.15.1

type HTTPRequestResponseVariable struct {
	Name string
	Path string
}

type HTTPRequestResult added in v1.15.0

type HTTPRequestResult struct {
	Err              string `json:"-"`
	StatusCode       int
	ResponseHeaders  map[string]string
	ResponseTrailers map[string]string
	BodyString       string
	Variables        map[string]string
	Request          CLIStepHTTPRequest
}

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 HTTPRequestTestHeader struct {
	Key   string
	Value string
}

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

func FetchLesson(uuid string) (*Lesson, error)

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 VerificationResultStructuredErrCLI added in v1.20.0

type VerificationResultStructuredErrCLI 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) (*VerificationResultStructuredErrCLI, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL