ring

package module
v0.0.0-...-23e758e Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 2 Imported by: 0

README

ring

A wrapper over container/ring that adds thread-safety and helper functions.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ring

type Ring[T any] struct {
	// contains filtered or unexported fields
}

Ring wraps container/ring and adds thread-safety and helper functions. Use New to create a new instance with a given size.

func New

func New[T any](size int) *Ring[T]

New returns a pointer to a new instance of Ring.

func (*Ring[T]) Add

func (r *Ring[T]) Add(v T)

Add an item

func (*Ring[T]) Slice

func (r *Ring[T]) Slice() []T

Jump to

Keyboard shortcuts

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