window

package
v1.10.6-rc.6 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: BSD-3-Clause Imports: 5 Imported by: 1

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