processors

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Processor added in v0.10.0

type Processor[T models.TokenConstraint] interface {
	Process(token T) (T, error)
}

func NewChangeNamespace

func NewChangeNamespace[T models.TokenConstraint](source, destination *string) Processor[T]

NewChangeNamespace creates new changeNamespace

func NewExpirationSetter

func NewExpirationSetter[T models.TokenConstraint](expired *atomic.Uint64, extraTTL int64, logger *slog.Logger,
) Processor[T]

NewExpirationSetter creates a new expirationSetter processor.

func NewFilterByBin

func NewFilterByBin[T models.TokenConstraint](binList []string, skipped *atomic.Uint64) Processor[T]

NewFilterByBin creates new filterByBin processor with given binList.

func NewFilterBySet

func NewFilterBySet[T models.TokenConstraint](setList []string, skipped *atomic.Uint64) Processor[T]

NewFilterBySet creates new filterBySet processor with given setList.

func NewFilterByType

func NewFilterByType[T models.TokenConstraint](noRecords, noIndexes, noUdf bool, skipped *atomic.Uint64) Processor[T]

NewFilterByType creates a new filterByType processor with the given flags.

func NewNoop

func NewNoop[T models.TokenConstraint]() Processor[T]

NewNoop creates a new noop processor.

func NewRecordCounter

func NewRecordCounter[T models.TokenConstraint](counter *atomic.Uint64) Processor[T]

NewRecordCounter creates a new record counter processor.

func NewSizeCounter

func NewSizeCounter[T models.TokenConstraint](counter *atomic.Uint64) Processor[T]

NewSizeCounter creates a new sizeCounter processor.

func NewTPSLimiter

func NewTPSLimiter[T models.TokenConstraint](ctx context.Context, n int) Processor[T]

NewTPSLimiter Create a new TPS limiter. n — allowed number of tokens per second, n = 0 means no limit.

func NewTokenCounter

func NewTokenCounter[T models.TokenConstraint](counter *atomic.Uint64) Processor[T]

NewTokenCounter returns new token counter.

func NewVoidTimeSetter

func NewVoidTimeSetter[T models.TokenConstraint](logger *slog.Logger) Processor[T]

NewVoidTimeSetter creates a new VoidTimeProcessor

type TokenCounter

type TokenCounter[T models.TokenConstraint] struct {
	// contains filtered or unexported fields
}

TokenCounter count processed tokens. It's like a record counter but for XDR. This counter will count the number of received XDR payloads.

func (TokenCounter[T]) Process

func (c TokenCounter[T]) Process(token T) (T, error)

Process counts the number of processed tokens.

Jump to

Keyboard shortcuts

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