Documentation
¶
Overview ¶
Package list implements a locking list.l
Index ¶
- Variables
- type Element
- type LockingList
- func (ll *LockingList) Back() *Element
- func (ll *LockingList) Contains(e any) bool
- func (ll *LockingList) ContainsDeep(e any) bool
- func (ll *LockingList) Front() *Element
- func (ll *LockingList) Init() *LockingList
- func (ll *LockingList) InsertAfter(v any, mark *Element) (*Element, error)
- func (ll *LockingList) InsertBefore(v any, mark *Element) (*Element, error)
- func (ll *LockingList) Len() int
- func (ll *LockingList) Lock() error
- func (ll *LockingList) MoveAfter(e, mark *Element) error
- func (ll *LockingList) MoveToBack(e *Element) error
- func (ll *LockingList) MoveToFront(e *Element) error
- func (ll *LockingList) Pop() any
- func (ll *LockingList) Push(item any) (err error)
- func (ll *LockingList) PushBack(v any) *Element
- func (ll *LockingList) PushBackList(other *LockingList) error
- func (ll *LockingList) PushFront(v any) *Element
- func (ll *LockingList) PushFrontList(other *LockingList) error
- func (ll *LockingList) RLock() error
- func (ll *LockingList) RUnlock()
- func (ll *LockingList) Remove(elm *Element) error
- func (ll *LockingList) Rotate() *Element
- func (ll *LockingList) Unlock()
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type LockingList ¶
func New ¶
func New() *LockingList
func (*LockingList) Back ¶
func (ll *LockingList) Back() *Element
func (*LockingList) Contains ¶ added in v1.0.0
func (ll *LockingList) Contains(e any) bool
Contains checks if the list contains e.
[Contains] iterates through the entire list until it finds e, this means it is quite slow.
func (*LockingList) ContainsDeep ¶ added in v1.0.0
func (ll *LockingList) ContainsDeep(e any) bool
ContainsDeep checks if the list contains e, or a value that is is deeply equal to e.
This function iterates through the entire list until it finds e, this means it is quite slow. [ContainsDeep] uses reflect.DeepEqual to compare values, this makes it even slower than [Contains].
func (*LockingList) Front ¶
func (ll *LockingList) Front() *Element
func (*LockingList) Init ¶
func (ll *LockingList) Init() *LockingList
Init initializes or clears list l.
func (*LockingList) InsertAfter ¶
func (ll *LockingList) InsertAfter(v any, mark *Element) (*Element, error)
func (*LockingList) InsertBefore ¶
func (ll *LockingList) InsertBefore(v any, mark *Element) (*Element, error)
func (*LockingList) Len ¶
func (ll *LockingList) Len() int
func (*LockingList) Lock ¶
func (ll *LockingList) Lock() error
func (*LockingList) MoveAfter ¶
func (ll *LockingList) MoveAfter(e, mark *Element) error
func (*LockingList) MoveToBack ¶
func (ll *LockingList) MoveToBack(e *Element) error
func (*LockingList) MoveToFront ¶
func (ll *LockingList) MoveToFront(e *Element) error
func (*LockingList) Pop ¶
func (ll *LockingList) Pop() any
func (*LockingList) Push ¶
func (ll *LockingList) Push(item any) (err error)
func (*LockingList) PushBack ¶
func (ll *LockingList) PushBack(v any) *Element
func (*LockingList) PushBackList ¶
func (ll *LockingList) PushBackList(other *LockingList) error
func (*LockingList) PushFront ¶
func (ll *LockingList) PushFront(v any) *Element
func (*LockingList) PushFrontList ¶
func (ll *LockingList) PushFrontList(other *LockingList) error
func (*LockingList) RLock ¶
func (ll *LockingList) RLock() error
func (*LockingList) RUnlock ¶
func (ll *LockingList) RUnlock()
func (*LockingList) Remove ¶
func (ll *LockingList) Remove(elm *Element) error
func (*LockingList) Rotate ¶
func (ll *LockingList) Rotate() *Element
Rotate moves the first element to the back of the list and returns it.
func (*LockingList) Unlock ¶
func (ll *LockingList) Unlock()
Click to show internal directories.
Click to hide internal directories.