nw_capture

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(client nw_client.Http) nw_client.Rest

Types

type Capture

type Capture interface {
	WithResponse(rb nw_client.RequestBuilder, req *http.Request, res es_response.Response, resErr error, latency int64)
}

func NewCapture

func NewCapture(ctx api_context.Context) Capture

type Client

type Client struct {
	// contains filtered or unexported fields
}

func (*Client) Call

type Record

type Record struct {
	Time    string          `json:"time"`
	Req     *nw_request.Req `json:"req"`
	Res     *Res            `json:"res"`
	Latency int64           `json:"latency"`
}

func (Record) IsSuccess

func (z Record) IsSuccess() bool

type Res

type Res struct {
	ResponseCode    int               `json:"code"`
	ResponseProto   string            `json:"proto,omitempty"`
	ResponseBody    string            `json:"body,omitempty"`
	ResponseHeaders map[string]string `json:"headers"`
	ResponseJson    json.RawMessage   `json:"json,omitempty"`
	ResponseError   string            `json:"error,omitempty"`
	ContentLength   int64             `json:"content_length"`
}

func (*Res) Apply

func (z *Res) Apply(res es_response.Response, resErr error)

Jump to

Keyboard shortcuts

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