ring

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AverageFloat64

func AverageFloat64(items []float64) float64

func MaxFloat64

func MaxFloat64(items []float64) float64

func MinFloat64

func MinFloat64(items []float64) float64

func StandardDeviationFloat64

func StandardDeviationFloat64(items []float64, calculatedAvg ...float64) float64

StandardDeviationFloat64

Types

type RedisRing

type RedisRing struct {
	// contains filtered or unexported fields
}

Ring Implementation of https://en.wikipedia.org/wiki/Circular_buffer

func NewRedisRing

func NewRedisRing(redisClient *redis.Client, capacity int, key string) *RedisRing

func (*RedisRing) Add

func (r *RedisRing) Add(ctx context.Context, item float64) error

func (*RedisRing) GetAll

func (r *RedisRing) GetAll(ctx context.Context) ([]float64, error)

func (*RedisRing) Size

func (r *RedisRing) Size() int

Jump to

Keyboard shortcuts

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