context

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Client   *http.Client   `json:"client,omitempty"`
	Request  *http.Request  `json:"request,omitempty"`
	Response *http.Response `json:"response,omitempty"`

	TimeTrace Time
	// contains filtered or unexported fields
}

func New

func New() *Context

func (*Context) Error

func (c *Context) Error() error

Error get context error

func (*Context) ErrorString

func (c *Context) ErrorString() string

ErrorString get context error as string

func (*Context) GetRequest

func (c *Context) GetRequest() *http.Request

func (*Context) HasError

func (c *Context) HasError() bool

HasError get context error as string

func (*Context) ResetError

func (c *Context) ResetError()

ResetError set context error to nil

func (*Context) SetError

func (c *Context) SetError(err error)

SetError set context error

func (*Context) TraceDo

func (c *Context) TraceDo() (err error)

TraceDo ...

type Time

type Time struct {
	Offset        time.Duration `json:"offset"`
	Duration      time.Duration `json:"duration"`
	ConnDuration  time.Duration `json:"connDuration"`  // connection setup(DNS lookup + Dial up) duration
	DNSDuration   time.Duration `json:"dnsDuration"`   // dns lookup duration
	ReqDuration   time.Duration `json:"reqDuration"`   // request "write" duration
	ResDuration   time.Duration `json:"resDuration"`   // response "read" duration
	DelayDuration time.Duration `json:"delayDuration"` // delay between response and request
}

Time ...

Jump to

Keyboard shortcuts

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