byte_pool

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BytePool

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

func NewBytePool

func NewBytePool(elemNum int, maxElemSize int) *BytePool

NewBytePool creates a new BytePool

PARAMS:

  • elemNum: int, the max element num of BytePool
  • maxElemSize: int, the max length of each element

RETURNS:

  • a pointer point to the BytePool

func (*BytePool) Get

func (pool *BytePool) Get(index int32) []byte

Get the byte slice

PARAMS:

  • index: int, index of the BytePool

RETURNS:

  • key: []byte type store in the BytePool

func (*BytePool) MaxElemSize

func (pool *BytePool) MaxElemSize() int

MaxElemSize returns the space allocate for each element

func (*BytePool) Set

func (pool *BytePool) Set(index int32, key []byte) error

Set sets the index node of BytePool with key

PARAMS:

  • index: index of the byte Pool
  • key: []byte key

type FixedBytePool

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

func NewFixedBytePool

func NewFixedBytePool(elemNum int, elemSize int) *FixedBytePool

NewFixedBytePool creates a new FixedBytePool

PARAMS:

  • elemNum: int, the max element num of FixedBytePool
  • elemSize: int, the max length of each element

RETURNS:

  • a pointer point to the FixedBytePool

func (*FixedBytePool) Get

func (pool *FixedBytePool) Get(index int32) []byte

Get the byte slice of giving index and length

PARAMS:

  • index: int, index of the FixedBytePool

RETURNS:

  • key: []byte type store in the FixedBytePool

func (*FixedBytePool) MaxElemSize

func (pool *FixedBytePool) MaxElemSize() int

MaxElemSize return the space allocate for each element

func (*FixedBytePool) Set

func (pool *FixedBytePool) Set(index int32, key []byte) error

Set sets the index node of FixedBytePool with key

PARAMS:

  • index: index of the byte Pool
  • key: []byte key

type IBytePool

type IBytePool interface {
	Set(int32, []byte) error
	Get(int32) []byte

	MaxElemSize() int
}

Jump to

Keyboard shortcuts

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