transport

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 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 Dumper

type Dumper interface {
	PreDump(target proto.Proto, response *http.Response)
	Dump(target proto.Proto, request *http.Request, response *http.Response, writer Writer) error
}

Dumper converts an HTTP response builder into bytes and writes it

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 Transport

type Transport interface {
	Parser
	Dumper
}

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