Help us shape the future of Go! Take the 2026 Go Developer Survey

window

package
v1.36.185 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 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