transport

package
v0.0.0-...-faeea24 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cut

func Cut(s, sep string) (before, after string, found bool)

Types

type H2C

type H2C struct{}

func (H2C) ReadResponse

func (h H2C) ReadResponse(ctx context.Context, s *h2c.Stream, req *http.PreparedRequest, resp *http.Response) error

func (H2C) RoundTrip

func (t H2C) RoundTrip(ctx context.Context, rw io.ReadWriteCloser, req *http.PreparedRequest, resp *http.Response) error

func (H2C) WriteRequest

func (h H2C) WriteRequest(ctx context.Context, s *h2c.Stream, req *http.PreparedRequest) error

type HTTP1

type HTTP1 struct{}

func (HTTP1) ReadResponse

func (t HTTP1) ReadResponse(ctx context.Context, r io.ReadCloser, req *http.PreparedRequest, resp *http.Response) (err error)

func (HTTP1) RoundTrip

func (t HTTP1) RoundTrip(ctx context.Context, rw io.ReadWriteCloser, req *http.PreparedRequest, resp *http.Response) error

func (HTTP1) WriteRequest

func (t HTTP1) WriteRequest(ctx context.Context, w io.Writer, r *http.PreparedRequest) error

type Transport

type Transport interface {
	RoundTrip(ctx context.Context, rw io.ReadWriteCloser, req *http.PreparedRequest, resp *http.Response) error
}

Transports holds an actions that Write [http.PreparedRequest]s to an underlying io.WriteCloser and then Read [http.Response]s from an io.ReadCloser which is supposedly the same connection the request is sent to. The Transport implementation should Close the io.WriteCloser after the entire request is sent and Close the io.ReadCloser after the entire response is read, including the request body. the Closer for the Response is usually hooked with the Body Closer returned to the user.

Transports SHOULD NOT hold states.

Directories

Path Synopsis
h2c

Jump to

Keyboard shortcuts

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