internal

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XForwardedProto             = "X-Forwarded-Proto"
	XForwardedFor               = "X-Forwarded-For"
	XForwardedHost              = "X-Forwarded-Host"
	XForwardedPort              = "X-Forwarded-Port"
	XForwardedServer            = "X-Forwarded-Server"
	XForwardedURI               = "X-Forwarded-Uri"
	XForwardedMethod            = "X-Forwarded-Method"
	XForwardedTLSClientCert     = "X-Forwarded-Tls-Client-Cert"
	XForwardedTLSClientCertInfo = "X-Forwarded-Tls-Client-Cert-Info"
	XRealIP                     = "X-Real-Ip"
	Connection                  = "Connection"
	Upgrade                     = "Upgrade"
)
View Source
const StatusClientClosedRequest = 499

StatusClientClosedRequest non-standard HTTP status code for client disconnection.

View Source
const StatusClientClosedRequestText = "Client Closed Request"

StatusClientClosedRequestText non-standard HTTP status for client disconnection.

Variables

View Source
var (
	BufferPool = buffer.NewPool()
	// Get retrieves a buffer from the pool, creating one if necessary.
	GetBuffer = BufferPool.Get
)
View Source
var (
	BufPool = NewBufPool()
)

Functions

func AcquireTimer

func AcquireTimer(timeout time.Duration) *time.Timer

AcquireTimer returns a time.Timer from the pool and updates it to send the current time on its channel after at least timeout.

The returned Timer may be returned to the pool with ReleaseTimer when no longer needed. This allows reducing GC load.

func Bytes

func Bytes(s string) (b []byte)

Bytes cost-free conversion of characters to byte streams

func EnsureLeadingSlash

func EnsureLeadingSlash(str string) string

EnsureLeadingSlash makes sure str has lead slash

func NewBufPool

func NewBufPool() *bufferPool

func ReleaseTimer

func ReleaseTimer(t *time.Timer)

ReleaseTimer returns the time.Timer acquired via AcquireTimer to the pool and prevents the Timer from firing.

Do not access the released time.Timer or read from it's channel otherwise data races may occur.

func StatusText

func StatusText(statusCode int) string

func String

func String(b []byte) (s string)

String cost-free conversion of byte stream to character

Types

This section is empty.

Jump to

Keyboard shortcuts

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