Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrSize = errors.New("maxSize can't be less than minSize")
)
Functions ¶
This section is empty.
Types ¶
type Map ¶ added in v1.0.2
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
func NewMap ¶ added in v1.0.2
func NewMap[K comparable, V any]() Map[K, V]
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool is actually multiple pools which store buffers of specific size. i.e. it can be three pools which return buffers 32K, 64K and 128K.
func NewBufferStore ¶
New returns Pool which has buckets from minSize to maxSize. Buckets increase with the power of two, i.e with multiplier 2: [2b, 4b, 16b, ... , 1024b] Last pool will always be capped to maxSize.
type RingBuffer ¶
type RingBuffer[T any] struct { // contains filtered or unexported fields }
环形缓冲
func NewRingBuf ¶
func NewRingBuf[T any](size int) *RingBuffer[T]
func (*RingBuffer[T]) IsFull ¶
func (r *RingBuffer[T]) IsFull() bool
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
不重复切片
func NewSet ¶
func NewSet[T comparable]() *Set[T]
Click to show internal directories.
Click to hide internal directories.