pools

package
v0.6.56 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: BSD-3-Clause Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Buffer = NewByteBuffer(4, 64<<10)
View Source
var Bytes = NewByteSlice(32, 64<<10)
View Source
var TinyBytes = NewByteSlice(4, 128)

Functions

func AcquireStringsBuilder added in v0.6.27

func AcquireStringsBuilder() *strings.Builder

func AcquireTimer

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

func AcquireWaitGroup

func AcquireWaitGroup() *sync.WaitGroup

func Go added in v0.1.1

func Go(f func())

func NewByteBuffer added in v0.1.4

func NewByteBuffer(min, max int) *byteBufferPool

NewByteBuffer creates new byteBufferPool that reuses objects which size is in logarithmic range [min, max].

Note that it is a shortcut for Custom() constructor with Options provided by WithLogSizeMapping() and WithLogSizeRange(min, max) calls.

func NewByteSlice added in v0.1.4

func NewByteSlice(min, max int) *byteSlicePool

NewByteSlice creates new byteSlicePool that reuses objects which size is in logarithmic range [min, max].

Note that it is a shortcut for Custom() constructor with Options provided by WithLogSizeMapping() and WithLogSizeRange(min, max) calls.

func ReleaseStringsBuilder added in v0.6.27

func ReleaseStringsBuilder(sb *strings.Builder)

func ReleaseTimer

func ReleaseTimer(t *time.Timer)

func ReleaseWaitGroup

func ReleaseWaitGroup(wg *sync.WaitGroup)

func ResetTimer

func ResetTimer(t *time.Timer, period time.Duration)

Types

type ByteBuffer added in v0.1.4

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

func (*ByteBuffer) AppendFrom added in v0.6.55

func (bb *ByteBuffer) AppendFrom(data []byte)

func (*ByteBuffer) AppendTo added in v0.6.55

func (bb *ByteBuffer) AppendTo(data []byte) []byte

func (*ByteBuffer) Bytes added in v0.1.4

func (bb *ByteBuffer) Bytes() *[]byte

func (ByteBuffer) Cap added in v0.2.6

func (bb ByteBuffer) Cap() int

func (*ByteBuffer) CopyFrom added in v0.6.55

func (bb *ByteBuffer) CopyFrom(data []byte)

func (*ByteBuffer) CopyTo added in v0.6.55

func (bb *ByteBuffer) CopyTo(data []byte) []byte

func (*ByteBuffer) Fill added in v0.1.9

func (bb *ByteBuffer) Fill(data []byte, start, end int)

func (*ByteBuffer) Len added in v0.1.9

func (bb *ByteBuffer) Len() int

func (*ByteBuffer) Read added in v0.6.54

func (bb *ByteBuffer) Read(p []byte) (n int, err error)

func (*ByteBuffer) Reset added in v0.1.4

func (bb *ByteBuffer) Reset()

func (*ByteBuffer) SetBytes added in v0.1.4

func (bb *ByteBuffer) SetBytes(b *[]byte)

Jump to

Keyboard shortcuts

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