model

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaptureItem

type CaptureItem struct {
	Request     Request                  `yaml:"request"`
	ReqPayload  DelayedReaderPersisterer `yaml:"-"`
	Response    Response                 `yaml:"response"`
	RespPayload DelayedReaderPersisterer `yaml:"-"`
}

type CaptureMatcher

type CaptureMatcher func(*http.Request, *CaptureItem) bool

type CaptureTransportMode

type CaptureTransportMode int
const (
	CaptureTransportModeNone   CaptureTransportMode = iota
	CaptureTransportModeRecord CaptureTransportMode = iota
	CaptureTransportModeFake   CaptureTransportMode = iota
)

type DelayedReaderPersisterer

type DelayedReaderPersisterer interface {
	io.ReadCloser
	Done() <-chan struct{}
	Payload() []byte
	IsNil() bool
}

type Request

type Request struct {
	Method           string
	URL              string
	Proto            string
	ProtoMajor       int
	ProtoMinor       int
	Header           http.Header
	Body             *string
	ContentLength    int64
	TransferEncoding []string
	Close            bool
	Host             string
	Form             url.Values
	PostForm         url.Values
	MultipartForm    *multipart.Form
	Trailer          http.Header
	RemoteAddr       string
	RequestURI       string
	//TLS              *tls.ConnectionState
	TestTimestamp time.Time `yaml:"testTimestamp"`
}

func NewRequest

func NewRequest(r0 *http.Request) Request

type Response

type Response struct {
	Status           string
	StatusCode       int
	Proto            string
	ProtoMajor       int
	ProtoMinor       int
	Header           http.Header
	Body             *string
	ContentLength    int64
	TransferEncoding []string
	Close            bool
	Uncompressed     bool
	Trailer          http.Header
	//TLS              *tls.ConnectionState
	TestTimestamp time.Time `yaml:"testTimestamp"`
}

func NewResponse

func NewResponse(r *http.Response) Response

func (Response) ToHttpResponse

func (r Response) ToHttpResponse() *http.Response

Jump to

Keyboard shortcuts

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