appendable

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIsEmpty = errors.New("appendable is empty")

ErrIsEmpty is returned when trying to get the latest value from an empty list.

Functions

This section is empty.

Types

type Appendable

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

Appendable is a thread-safe list that can be appended to.

func (*Appendable[T]) All

func (a *Appendable[T]) All() []T

All returns all values in the list.

func (*Appendable[T]) Append

func (a *Appendable[T]) Append(value T)

Append adds a value to the list.

func (*Appendable[T]) Latest

func (a *Appendable[T]) Latest() (T, error)

Latest returns the latest value in the list.

Jump to

Keyboard shortcuts

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