http2

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientProto added in v0.11.0

func ClientProto(cc *http2.MClientConn) types.Protocol

func DecodeHeader

func DecodeHeader(header types.HeaderMap) types.HeaderMap

func EncodeHeader

func EncodeHeader(header types.HeaderMap) http.Header

func ServerProto added in v0.11.0

func ServerProto(sc *http2.MServerConn) types.Protocol

Types

type HeaderMap

type HeaderMap struct {
	H http.Header
}

func NewHeaderMap

func NewHeaderMap(header http.Header) *HeaderMap

func (*HeaderMap) Add

func (h *HeaderMap) Add(key string, value string)

Set key-value pair in header map, the previous pair will be replaced if exists

func (HeaderMap) ByteSize

func (h HeaderMap) ByteSize() uint64

func (*HeaderMap) Clone

func (h *HeaderMap) Clone() types.HeaderMap

func (*HeaderMap) Del

func (h *HeaderMap) Del(key string)

Del delete pair of specified key

func (*HeaderMap) Get

func (h *HeaderMap) Get(key string) (value string, ok bool)

Get value of key

func (HeaderMap) Range

func (h HeaderMap) Range(f func(key, value string) bool)

Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.

func (*HeaderMap) Set

func (h *HeaderMap) Set(key string, value string)

Add value for given key. Multiple headers with the same key may be added with this function. Use Set for setting a single header for the given key.

type Http2BufferCtx

type Http2BufferCtx struct {
	buffer.TempBufferCtx
}

func (Http2BufferCtx) New

func (ctx Http2BufferCtx) New() interface{}

func (Http2BufferCtx) Reset

func (ctx Http2BufferCtx) Reset(i interface{})

type Http2Buffers

type Http2Buffers struct {
}

func Http2BuffersByContext

func Http2BuffersByContext(ctx context.Context) *Http2Buffers

type ReqHeader

type ReqHeader struct {
	*HeaderMap
	Req *http.Request
}

func NewReqHeader

func NewReqHeader(req *http.Request) *ReqHeader

func (*ReqHeader) Clone

func (h *ReqHeader) Clone() types.HeaderMap

func (*ReqHeader) Get

func (h *ReqHeader) Get(key string) (string, bool)

type RspHeader

type RspHeader struct {
	*HeaderMap
	Rsp *http.Response
}

func NewRspHeader

func NewRspHeader(rsp *http.Response) *RspHeader

func (*RspHeader) Clone

func (h *RspHeader) Clone() types.HeaderMap

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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