h2

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ConnTag = "h2conn"

Variables

View Source
var ErrHTTP2NotSupported = fmt.Errorf("HTTP2 not supported")

Functions

func Close

func Close()

func ServeHTTP

func ServeHTTP(w http.ResponseWriter, r *http.Request, config config.Config, iFace *water.Interface)

func StartClient

func StartClient(iFace *water.Interface, config config.Config)

StartClient starts the h2 client

func StartClientForApi

func StartClientForApi(config config.Config, outputStream <-chan []byte, inputStream chan<- []byte, writeCallback, readCallback func(int), _ctx context.Context)

func StartServer

func StartServer(iFace *water.Interface, config config.Config)

StartServer starts the h2 server

Types

type Client

type Client struct {
	Method string
	Header http.Header
	Client *http.Client
}

func (*Client) Connect

func (c *Client) Connect(ctx context.Context, urlStr string) (*Conn, *http.Response, error)

type Conn

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

func Accept

func Accept(w http.ResponseWriter, r *http.Request) (*Conn, error)

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) Read

func (c *Conn) Read(data []byte) (int, error)

func (*Conn) Write

func (c *Conn) Write(data []byte) (int, error)

type Server

type Server struct {
	StatusCode int
}

func (*Server) Accept

func (u *Server) Accept(w http.ResponseWriter, r *http.Request) (*Conn, error)

Jump to

Keyboard shortcuts

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