util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package util provides generic helpers shared across the project.

Index

Constants

This section is empty.

Variables

View Source
var ErrPoolClosed = errors.New("pool is closed")

Functions

func Unique

func Unique[T comparable](in []T) []T

Unique deduplicates a slice while preserving order.

Types

type Pool

type Pool[T any] struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool[T any](max int, constructor func() T, destructor func(T)) *Pool[T]

func (*Pool[T]) Acquire

func (p *Pool[T]) Acquire() (T, error)

func (*Pool[T]) Close

func (p *Pool[T]) Close()

func (*Pool[T]) Release

func (p *Pool[T]) Release(v T)

Jump to

Keyboard shortcuts

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