util

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: AGPL-3.0 Imports: 4 Imported by: 1

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 added in v0.16.7

type BufferCloseMethod func(*bytes.Buffer)

type BufferFactoryMethod added in v0.16.7

type BufferFactoryMethod func() *bytes.Buffer

Factory is a function to create new connections.

type Pool added in v0.16.7

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

func NewBufferPool added in v0.16.7

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

func (*Pool[T]) Done added in v0.16.7

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

func (*Pool[T]) Get added in v0.16.7

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

func (*Pool[T]) Len added in v0.16.7

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

func (*Pool[T]) Put added in v0.16.7

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