h2conn

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 9 Imported by: 3

Documentation

Overview

Package h2conn implements a net.Conn reads and writes over which are actually directed towards a h/2 stream.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T

type T struct {
	net.Conn
	io.ReadCloser
	io.WriteCloser
	// contains filtered or unexported fields
}

T is the type of h/2 overlay connections.

func New

func New(t http.RoundTripper, remote string, headers map[string]string) (c *T, err error)

New creates a new T given a http.Roundtripper and a remote URL string to connect to via h/2 as well as any headers that are needed.

func (*T) Close

func (c *T) Close() error

Close closes both the sent request body and the response body.

func (*T) LocalAddr added in v0.3.1

func (c *T) LocalAddr() net.Addr

func (*T) Read

func (c *T) Read(p []byte) (int, error)

Read makes the initial request if needed, after which it reads from the response body if no error was encountered.

func (*T) RemoteAddr added in v0.3.1

func (c *T) RemoteAddr() net.Addr

func (*T) SetDeadline

func (c *T) SetDeadline(t time.Time) error

func (*T) SetReadDeadline added in v0.3.1

func (c *T) SetReadDeadline(t time.Time) error

TODO?

func (*T) SetWriteDeadline added in v0.3.1

func (c *T) SetWriteDeadline(t time.Time) error

func (*T) Write

func (c *T) Write(p []byte) (int, error)

Write writes the given data to a pipe the other end of which is read as the sent request body.

Jump to

Keyboard shortcuts

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