listx

package
v0.11.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SafeList

type SafeList[T any] struct {
	sync.RWMutex
	L *list.List
}

SafeList is a thread-safe list

func NewSafeList

func NewSafeList[T any]() *SafeList[T]

func (*SafeList[T]) Len

func (sl *SafeList[T]) Len() int

func (*SafeList[T]) PopBackAll

func (sl *SafeList[T]) PopBackAll() []T

func (*SafeList[T]) PopBackN

func (sl *SafeList[T]) PopBackN(n int) []T

func (*SafeList[T]) PushFront

func (sl *SafeList[T]) PushFront(v T) *list.Element

func (*SafeList[T]) PushFrontN

func (sl *SafeList[T]) PushFrontN(vs []T)

func (*SafeList[T]) RemoveAll

func (sl *SafeList[T]) RemoveAll()

type SafeListLimited

type SafeListLimited[T any] struct {
	SL *SafeList[T]
	// contains filtered or unexported fields
}

SafeListLimited is SafeList with Limited Size

func NewSafeListLimited

func NewSafeListLimited[T any](maxSize int) *SafeListLimited[T]

func (*SafeListLimited[T]) Len

func (sll *SafeListLimited[T]) Len() int

func (*SafeListLimited[T]) PopBackAll

func (sll *SafeListLimited[T]) PopBackAll() []T

func (*SafeListLimited[T]) PopBackN

func (sll *SafeListLimited[T]) PopBackN(n int) []T

func (*SafeListLimited[T]) PushFront

func (sll *SafeListLimited[T]) PushFront(v T) bool

func (*SafeListLimited[T]) PushFrontN

func (sll *SafeListLimited[T]) PushFrontN(vs []T) bool

func (*SafeListLimited[T]) RemoveAll

func (sll *SafeListLimited[T]) RemoveAll()

Jump to

Keyboard shortcuts

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