preparams

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled             bool
	TargetSize          int
	MaxConcurrency      int
	GenerateTimeout     time.Duration
	AcquireTimeout      time.Duration
	RetryBackoff        time.Duration
	SyncFallbackOnEmpty bool
	FileCacheEnabled    bool
	FileCacheDir        string
}

func DefaultConfig

func DefaultConfig() Config

type Generator

type Generator func(ctx context.Context) (*ecdsakeygen.LocalPreParams, error)

type Pool

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

func NewPool

func NewPool(logger *slog.Logger, cfg Config) *Pool

func (*Pool) Acquire

func (p *Pool) Acquire(ctx context.Context) (*ecdsakeygen.LocalPreParams, error)

func (*Pool) Close

func (p *Pool) Close() error

func (*Pool) Size

func (p *Pool) Size() int

func (*Pool) Snapshot

func (p *Pool) Snapshot() Snapshot

func (*Pool) Start

func (p *Pool) Start(ctx context.Context) error

type Snapshot

type Snapshot struct {
	Size               int
	InFlight           int32
	GenerationsSuccess uint64
	GenerationsFailed  uint64
	AcquireCount       uint64
	AcquireWaitNanos   int64
	PoolEmptyCount     uint64
	SyncFallbackCount  uint64
	LastGenerateNanos  int64
}

type Validator

type Validator func(params *ecdsakeygen.LocalPreParams) bool

Jump to

Keyboard shortcuts

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