window

package
v1.10.18-wip-p2p-bloom... Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: BSD-3-Clause Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Clock   *mockable.Clock
	MaxSize int
	MinSize int
	TTL     time.Duration
}

Config exposes parameters for Window

type Window

type Window[T any] interface {
	Add(value T)
	Oldest() (T, bool)
	Length() int
}

Window is an interface which represents a sliding window of elements.

func New

func New[T any](config Config) Window[T]

New returns an instance of window

Jump to

Keyboard shortcuts

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