util

package
v0.16.8 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSystemInTestMode

func IsSystemInTestMode() bool

IsSystemInTestMode checks if the system is running for tests.

func StringInSlice

func StringInSlice(a string, list []string) bool

StringInSlice checks if the given string is in the given list of strings

Types

type BufferCloseMethod

type BufferCloseMethod func(*bytes.Buffer)

type BufferFactoryMethod

type BufferFactoryMethod func() *bytes.Buffer

Factory is a function to create new connections.

type Pool

type Pool[T any] struct {
	Items   chan T
	Factory func() T
	Close   func(T)
}

func NewBufferPool

func NewBufferPool(initialCap, maxCap int, factory BufferFactoryMethod, close BufferCloseMethod) (*Pool[*bytes.Buffer], error)

func (*Pool[T]) Done

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

func (*Pool[T]) Get

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

func (*Pool[T]) Len

func (p *Pool[T]) Len() int

func (*Pool[T]) Put

func (p *Pool[T]) Put(item T) error

Jump to

Keyboard shortcuts

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