window

package
v1.11.10 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

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