pool

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapPool

type MapPool[T ~*map[K]S, K comparable, S any] struct {
	// contains filtered or unexported fields
}

func NewMap

func NewMap[T ~*map[K]S, K comparable, S any](name string, fn func() T) *MapPool[T, K, S]

func (*MapPool[T, _, _]) Get

func (p *MapPool[T, _, _]) Get() T

func (*MapPool[T, _, _]) Put

func (p *MapPool[T, _, _]) Put(t T)

type Pool

type Pool[T ~*S, S any] struct {
	// contains filtered or unexported fields
}

func New

func New[T ~*S, S any](name string, fn func() T) *Pool[T, S]

func (*Pool[T, _]) Get

func (p *Pool[T, _]) Get() T

func (*Pool[T, _]) Put

func (p *Pool[T, _]) Put(t T)

type SlicePool

type SlicePool[T ~*[]S, S any] struct {
	// contains filtered or unexported fields
}

func NewSlice

func NewSlice[T ~*[]S, S any](name string, fn func() T) *SlicePool[T, S]

func (*SlicePool[T, _]) Get

func (p *SlicePool[T, _]) Get() T

func (*SlicePool[T, _]) Put

func (p *SlicePool[T, _]) Put(t T)

Jump to

Keyboard shortcuts

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