pool

package
v1.19.4 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferPool

type BufferPool struct {
	// contains filtered or unexported fields
}

BufferPool provides a pool of byte slices for use as buffers.

func NewBufferPool

func NewBufferPool(count int) *BufferPool

NewBufferPool creates a pool of byte slices.

func (*BufferPool) Get

func (bp *BufferPool) Get(size int64) []byte

Get retrieves a byte buffer with the required capacity.

func (*BufferPool) Put

func (bp *BufferPool) Put(buf []byte)

Put returns a byte buffer to the pool for future reuse.

type ScannerPool

type ScannerPool struct {
	// contains filtered or unexported fields
}

ScannerPool provides a pool of yara-x scanners.

func NewScannerPool

func NewScannerPool(yrs *yarax.Rules, count int) *ScannerPool

NewScannerPool creates a pool containing the specified number of yara-x scanners.

func (*ScannerPool) Close added in v1.13.0

func (sp *ScannerPool) Close()

Close destroys all active scanners. Currently unused.

func (*ScannerPool) Get

func (sp *ScannerPool) Get(yrs *yarax.Rules) *yarax.Scanner

Get retrieves a scanner from the scanner pool, blocking if none are available.

func (*ScannerPool) Put

func (sp *ScannerPool) Put(scanner *yarax.Scanner)

Put returns a scanner to the scanner pool.

Jump to

Keyboard shortcuts

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