Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ThreadSafe ¶ added in v2.9.1
type ThreadSafe[T any] struct { // contains filtered or unexported fields }
ThreadSafe type that can be safely shared between goroutines.
func NewThreadSafe ¶ added in v2.9.1
func NewThreadSafe[T any]() *ThreadSafe[T]
NewThreadSafe creates a new lock-free thread-safe slice.
func (*ThreadSafe[T]) Append ¶ added in v2.9.1
func (cs *ThreadSafe[T]) Append(item T)
Append adds an item to the concurrent slice.
func (*ThreadSafe[T]) AppendMany ¶ added in v2.10.0
func (cs *ThreadSafe[T]) AppendMany(item ...T)
AppendMany adds many items to the concurrent slice
func (*ThreadSafe[T]) Delete ¶ added in v2.9.1
func (cs *ThreadSafe[T]) Delete(index int)
Delete an item from the slice
func (*ThreadSafe[T]) Get ¶ added in v2.9.1
func (cs *ThreadSafe[T]) Get(index int) (item T)
Get returns the slice item at the given index
func (*ThreadSafe[T]) Items ¶ added in v2.9.1
func (cs *ThreadSafe[T]) Items() []T
Items returns the list of items
func (*ThreadSafe[T]) Len ¶ added in v2.9.1
func (cs *ThreadSafe[T]) Len() int
Len returns the number of items
func (*ThreadSafe[T]) Reset ¶ added in v2.9.1
func (cs *ThreadSafe[T]) Reset()
Reset resets the slice
Click to show internal directories.
Click to hide internal directories.