window

package
v1.9.0-rc.24 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: BSD-3-Clause Imports: 5 Imported by: 2

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
	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