fastclient

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Dial                      func() (net.Conn, error)
	MaxConns                  int
	MaxIdleConnDuration       time.Duration
	MaxIdempotentCallAttempts int
	ReadBufferSize            int
	WriteBufferSize           int
	ReadTimeout               time.Duration
	WriteTimeout              time.Duration
	MaxConnWaitTimeout        time.Duration
	// contains filtered or unexported fields
}

func (*Client) RoundTrip

func (t *Client) RoundTrip(req *fasthttp.Request, res *fasthttp.Response) error

RoundTrip does an HTTP/1.1 RoundTrip as quickly as possible and handles streaming the data with as few copies as possible.

It's important to note that the returned *bytebufferpool.ByteBuffer will always be nil if an error is returned. This means if the returning function returns an error, we do not need to recycle the bytebuffer pool.

It should also be noted that the *bytebufferpool.ByteBuffer will be filled in asynchronously when the response is written to an io.Writer (like a net.Conn) or when res.Body() is called.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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