transport

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser interface {
	Parse(b []byte) (state RequestState, extra []byte, err error)
}

type RequestState

type RequestState uint8

RequestState represents the state of the request's parsing

const (
	Pending RequestState = iota + 1
	HeadersCompleted
	Error
)

type Serializer added in v0.15.0

type Serializer interface {
	PreWrite(target proto.Proto, response *http.Response)
	Write(target proto.Proto, request *http.Request, response *http.Response, writer Writer) error
}

Serializer converts an HTTP response builder into bytes and writes it

type Transport

type Transport interface {
	Parser
	Serializer
}

Transport is a general pair of a parser and a dumper. Usually consists of both belonging to a same protocol major version

type Writer

type Writer interface {
	Write([]byte) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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