Documentation ¶
Index ¶
- type List
- func (l *List[T]) Append(items ...T)
- func (l *List[T]) At(index int) T
- func (l *List[T]) Cap() int
- func (l *List[T]) Delete(index int)
- func (l *List[T]) Find(f func(index int, val T) bool) int
- func (l *List[T]) FindAndDelete(f func(i int, v T) bool) (deleted bool)
- func (l *List[T]) Foreach(f func(index int, val T) (shouldBreak bool))
- func (l *List[T]) Get() []T
- func (l *List[T]) Len() int
- func (l *List[T]) Make(length int, capacity ...int)
- func (l *List[T]) MarshalJSON() ([]byte, error)
- func (l *List[T]) Nil() bool
- func (l *List[T]) Prepend(items ...T)
- func (l *List[T]) Read(f func())
- func (l *List[T]) Set(items []T)
- func (l *List[T]) Slice(start, end int) []T
- func (l *List[T]) SliceInPlace(start, end int)
- func (l *List[T]) Sort(less func(i, j T) int)
- func (l *List[T]) UnmarshalJSON(b []byte) error
- func (l *List[T]) UnsafeAppend(items ...T)
- func (l *List[T]) UnsafeAt(index int) T
- func (l *List[T]) UnsafeCap() int
- func (l *List[T]) UnsafeDelete(index int)
- func (l *List[T]) UnsafeFind(f func(index int, val T) bool) int
- func (l *List[T]) UnsafeFindAndDelete(f func(i int, v T) bool) (deleted bool)
- func (l *List[T]) UnsafeForeach(f func(index int, val T) (shouldBreak bool))
- func (l *List[T]) UnsafeGet() []T
- func (l *List[T]) UnsafeLen() int
- func (l *List[T]) UnsafeMake(length int, capacity ...int)
- func (l *List[T]) UnsafeMarshalJSON() ([]byte, error)
- func (l *List[T]) UnsafeNil() bool
- func (l *List[T]) UnsafePrepend(items ...T)
- func (l *List[T]) UnsafeSet(items []T)
- func (l *List[T]) UnsafeSlice(start, end int) []T
- func (l *List[T]) UnsafeSliceInPlace(start, end int)
- func (l *List[T]) UnsafeSort(less func(i, j T) int)
- func (l *List[T]) UnsafeUnmarshalJSON(b []byte) error
- func (l *List[T]) Write(f func())
- type Locker
- type Map
- func (m *Map[K, V]) Clear()
- func (m *Map[K, V]) Clone() *Map[K, V]
- func (m *Map[K, V]) Copy(dst *Map[K, V])
- func (m *Map[K, V]) Delete(k K) (v V, has bool)
- func (m *Map[K, V]) DeleteFunc(del func(K, V) bool)
- func (m *Map[K, V]) EqualFunc(m2 *Map[K, V], eq func(V, V) bool) bool
- func (m *Map[K, V]) Foreach(f func(k K, v V))
- func (m *Map[K, V]) Get(k K) (v V, has bool)
- func (m *Map[K, V]) Has(k K) bool
- func (m *Map[K, V]) Keys() []K
- func (m *Map[K, V]) Len() int
- func (m *Map[K, V]) Make()
- func (m *Map[K, V]) MarshalJSON() ([]byte, error)
- func (m *Map[K, V]) Nil() bool
- func (m *Map[K, V]) Set(k K, v V)
- func (m *Map[K, V]) UnmarshalJSON(b []byte) error
- func (m *Map[K, V]) UnsafeClear()
- func (m *Map[K, V]) UnsafeClone() *Map[K, V]
- func (m *Map[K, V]) UnsafeCopy(dst *Map[K, V])
- func (m *Map[K, V]) UnsafeDelete(k K) (v V, has bool)
- func (m *Map[K, V]) UnsafeDeleteFunc(del func(K, V) bool)
- func (m *Map[K, V]) UnsafeEqualFunc(m2 *Map[K, V], eq func(V, V) bool) bool
- func (m *Map[K, V]) UnsafeForeach(f func(k K, v V))
- func (m *Map[K, V]) UnsafeGet(k K) (v V, has bool)
- func (m *Map[K, V]) UnsafeHas(k K) bool
- func (m *Map[K, V]) UnsafeKeys() []K
- func (m *Map[K, V]) UnsafeLen() int
- func (m *Map[K, V]) UnsafeMake()
- func (m *Map[K, V]) UnsafeMarshalJSON() ([]byte, error)
- func (m *Map[K, V]) UnsafeNil() bool
- func (m *Map[K, V]) UnsafeSet(k K, v V)
- func (m *Map[K, V]) UnsafeUnmarshalJSON(b []byte) error
- func (m *Map[K, V]) UnsafeValues() []V
- func (m *Map[K, V]) Values() []V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type List ¶
A lockable list that provides some list-like methods for convienence
func (*List[T]) Append ¶
func (l *List[T]) Append(items ...T)
Append adds the given items to the back of the list
func (*List[T]) Find ¶
Find returns the first index where the given function returns true. Will return length of the list if item was not found
func (*List[T]) FindAndDelete ¶
FindAndDelete deletes the first item where the given function returns true.
func (*List[T]) MarshalJSON ¶
func (*List[T]) Prepend ¶
func (l *List[T]) Prepend(items ...T)
Prepend add the given items to the front of the list
func (*List[T]) Set ¶
func (l *List[T]) Set(items []T)
Set replaces the internal list with the given list
func (*List[T]) SliceInPlace ¶
func (*List[T]) UnmarshalJSON ¶
func (*List[T]) UnsafeAppend ¶
func (l *List[T]) UnsafeAppend(items ...T)
func (*List[T]) UnsafeDelete ¶
func (*List[T]) UnsafeFindAndDelete ¶
func (*List[T]) UnsafeForeach ¶
func (*List[T]) UnsafeMake ¶
func (*List[T]) UnsafeMarshalJSON ¶
func (*List[T]) UnsafePrepend ¶
func (l *List[T]) UnsafePrepend(items ...T)
func (*List[T]) UnsafeSlice ¶
func (*List[T]) UnsafeSliceInPlace ¶
func (*List[T]) UnsafeSort ¶
func (*List[T]) UnsafeUnmarshalJSON ¶
type Locker ¶
type Map ¶
type Map[K comparable, V any] struct { Locker[map[K]V] }
func NewMap ¶
func NewMap[K comparable, V any]() *Map[K, V]
func (*Map[K, V]) DeleteFunc ¶
func (*Map[K, V]) MarshalJSON ¶
func (*Map[K, V]) UnmarshalJSON ¶
func (*Map[K, V]) UnsafeClear ¶
func (m *Map[K, V]) UnsafeClear()
func (*Map[K, V]) UnsafeClone ¶
func (*Map[K, V]) UnsafeCopy ¶
func (*Map[K, V]) UnsafeDelete ¶
func (*Map[K, V]) UnsafeDeleteFunc ¶
func (*Map[K, V]) UnsafeEqualFunc ¶
func (*Map[K, V]) UnsafeForeach ¶
func (m *Map[K, V]) UnsafeForeach(f func(k K, v V))
func (*Map[K, V]) UnsafeKeys ¶
func (m *Map[K, V]) UnsafeKeys() []K
func (*Map[K, V]) UnsafeMake ¶
func (m *Map[K, V]) UnsafeMake()
func (*Map[K, V]) UnsafeMarshalJSON ¶
func (*Map[K, V]) UnsafeUnmarshalJSON ¶
func (*Map[K, V]) UnsafeValues ¶
func (m *Map[K, V]) UnsafeValues() []V
Click to show internal directories.
Click to hide internal directories.