types

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointConfig

type EndpointConfig struct {
	Route              string                 `json:"route"`
	Method             string                 `json:"method"`
	Response           EndpointConfigResponse `json:"response"`
	ResponseStatusCode int                    `json:"response_status_code"`
	ResponseIf         []ResponseIf           `json:"response_if"`
	Headers            map[string]string      `json:"response_headers"`
	HeadersBase        map[string]string      `json:"response_headers_base"`
}

type EndpointConfigResponse

type EndpointConfigResponse []byte

func (*EndpointConfigResponse) UnmarshalJSON

func (this *EndpointConfigResponse) UnmarshalJSON(data []byte) (err error)

type Endpoint_content_type

type Endpoint_content_type int
const (
	Endpoint_content_type_file Endpoint_content_type = iota
	Endpoint_content_type_shell
	Endpoint_content_type_exec
	Endpoint_content_type_fileserver
	Endpoint_content_type_json
	Endpoint_content_type_plaintext
	Endpoint_content_type_unknown
)

type MockFs

type MockFs interface {
	StoreRequestRecord(r *http.Request, requestBody []byte, endpointConfig *EndpointConfig) error
	GetRecordsMatchingRoute(route string) ([]RequestRecord, error)
	RemoveAllRequestRecords() error
}

type RequestRecord

type RequestRecord struct {
	Route       string      `json:"route"`
	Querystring string      `json:"querystring"`
	Method      string      `json:"method"`
	Headers     http.Header `json:"headers"`
	Body        *[]byte     `json:"body"`
}

type ResponseIf

type ResponseIf struct {
	Response           EndpointConfigResponse `json:"response"`
	ResponseStatusCode int                    `json:"response_status_code"`
	Condition          *Condition             `json:"condition"`
	Headers            map[string]string      `json:"response_headers"`
}

type State

type State struct {
	ListenPort                 string
	RequestRecordDirectoryPath string
	ConfigFolderPath           string
}

Jump to

Keyboard shortcuts

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