client

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(host string, port int, verbose bool) *client

Types

type ClearRequest

type ClearRequest struct {
	ExpectationID ExpectationID `json:"expectationId"`
}

type Delay

type Delay struct {
	TimeUnit TimeUnit `json:"timeUnit"`
	Value    int      `json:"value"`
}

type Expectation

type Expectation struct {
	ID           string        `json:"id"`
	Priority     int           `json:"priority"`
	HTTPRequest  *HTTPRequest  `json:"httpRequest,omitempty"`
	HTTPResponse *HTTPResponse `json:"httpResponse,omitempty"`
	Times        *Times        `json:"times,omitempty"`
	TimeToLive   *TimeToLive   `json:"timeToLive,omitempty"`
	HTTPError    *HTTPError    `json:"httpError,omitempty"`
}

type ExpectationID

type ExpectationID struct {
	ID string `json:"id"`
}

type HTTPError

type HTTPError struct {
	Delay          *Delay `json:"delay,omitempty"`
	DropConnection bool   `json:"dropConnection"`
	ResponseBytes  string `json:"responseBytes,omitempty"`
}

type HTTPRequest

type HTTPRequest struct {
	Method                string                 `json:"method"`
	Path                  string                 `json:"path"`
	PathParameters        map[string][]string    `json:"pathParameters,omitempty"`
	QueryStringParameters map[string][]string    `json:"queryStringParameters,omitempty"`
	Headers               map[string]interface{} `json:"headers,omitempty"`
	Body                  interface{}            `json:"body,omitempty"`
}

type HTTPResponse

type HTTPResponse struct {
	Body         interface{}            `json:"body,omitempty"`
	StatusCode   int                    `json:"statusCode"`
	ReasonPhrase string                 `json:"reasonPhrase,omitempty"`
	Headers      map[string]interface{} `json:"headers,omitempty"`
	Delay        *Delay                 `json:"delay,omitempty"`
}

type RetrieveRequest

type RetrieveRequest HTTPRequest

type RetrieveResponse

type RetrieveResponse []HTTPRequest

type TimeToLive

type TimeToLive struct {
	TimeUnit   TimeUnit `json:"timeUnit,omitempty"`
	TimeToLive int      `json:"timeToLive,omitempty"`
	Unlimited  bool     `json:"unlimited"`
}

type TimeUnit

type TimeUnit string
const (
	DAYS         TimeUnit = "DAYS"
	HOURS        TimeUnit = "HOURS"
	MINUTES      TimeUnit = "MINUTES"
	SECONDS      TimeUnit = "SECONDS"
	MILLISECONDS TimeUnit = "MILLISECONDS"
	MICROSECONDS TimeUnit = "MICROSECONDS"
	NANOSECONDS  TimeUnit = "NANOSECONDS"
)

type Times

type Times struct {
	RemainingTimes int  `json:"remainingTimes"`
	Unlimited      bool `json:"unlimited"`
}

type VerificationTimes

type VerificationTimes struct {
	AtLeast int `json:"atLeast"`
	AtMost  int `json:"atMost"`
}

type Verify

type Verify struct {
	ExpectationID ExpectationID      `json:"expectationId"`
	HTTPRequest   *HTTPRequest       `json:"httpRequest,omitempty"`
	Times         *VerificationTimes `json:"times,omitempty"`
}

type VerifySequence

type VerifySequence struct {
	ExpectationIDs []ExpectationID `json:"expectationIds,omitempty"`
	HTTPRequests   *HTTPRequest    `json:"httpRequest,omitempty"`
}

Jump to

Keyboard shortcuts

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