bytes

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CR .
	CR = '\r'
	// LF .
	LF = '\n'
	// COL .
	COL = ':'
	// SPA .
	SPA = ' '
)

Variables

View Source
var (
	ErrInvalidLength   = errors.New("invalid length")
	ErrInvalidPosition = errors.New("invalid position")
	ErrNotEnougth      = errors.New("bytes not enougth")
)
View Source
var (
	// ErrDataNotEnouth .
	ErrDataNotEnouth = errors.New("data not enougth")
	// ErrInvalidData .
	ErrInvalidData = errors.New("invalid data")
)

Functions

This section is empty.

Types

type Buffer

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

Buffer .

func NewBuffer

func NewBuffer() *Buffer

NewBuffer .

func (*Buffer) Append

func (bb *Buffer) Append(b []byte)

Append .

func (*Buffer) Head

func (bb *Buffer) Head(n int) ([]byte, error)

Head .

func (*Buffer) Len

func (bb *Buffer) Len() int

Len .

func (*Buffer) OnRelease

func (bb *Buffer) OnRelease(onRelease func(b []byte))

func (*Buffer) Pop

func (bb *Buffer) Pop(n int) ([]byte, error)

Pop .

func (*Buffer) Push

func (bb *Buffer) Push(b []byte)

Push .

func (*Buffer) Read

func (bb *Buffer) Read(n int) ([]byte, error)

Read .

func (*Buffer) ReadAll

func (bb *Buffer) ReadAll() ([]byte, error)

ReadAll .

func (*Buffer) Reset

func (bb *Buffer) Reset()

Reset .

func (*Buffer) Sub

func (bb *Buffer) Sub(from, to int) ([]byte, error)

Sub .

func (*Buffer) Write

func (bb *Buffer) Write(b []byte)

Write .

type HTTPBuffer

type HTTPBuffer struct {
	Buffer
	// contains filtered or unexported fields
}

HTTPBuffer .

func NewHTTPBuffer

func NewHTTPBuffer() *HTTPBuffer

NewHTTPBuffer .

func (*HTTPBuffer) Push

func (hb *HTTPBuffer) Push(b []byte)

Push .

func (*HTTPBuffer) ReadHeader

func (hb *HTTPBuffer) ReadHeader() (headKey string, headValue string, ok bool, err error)

ReadHeader .

func (*HTTPBuffer) ReadRequestLine

func (hb *HTTPBuffer) ReadRequestLine() (method string, requestURI string, proto string, err error)

ReadRequestLine .

func (*HTTPBuffer) ReadResponseLine

func (hb *HTTPBuffer) ReadResponseLine() (method string, requestURI string, proto string, status string, err error)

ReadResponseLine .

Jump to

Keyboard shortcuts

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