Documentation ¶
Index ¶
- type DoublyLinkedList
- func (l *DoublyLinkedList) GetValue() [][]byte
- func (l *DoublyLinkedList) LIndex(index int64) []byte
- func (l *DoublyLinkedList) LInsert(pivot, data []byte, before bool) int64
- func (l *DoublyLinkedList) LLen() int64
- func (l *DoublyLinkedList) LPop(count int64) [][]byte
- func (l *DoublyLinkedList) LPush(data ...[]byte)
- func (l *DoublyLinkedList) LPushX(data []byte) int64
- func (l *DoublyLinkedList) LRange(start, end int64) [][]byte
- func (l *DoublyLinkedList) LRem(count int64, value []byte) int64
- func (l *DoublyLinkedList) LSet(index int64, value []byte) bool
- func (l *DoublyLinkedList) LTrim(start, end int64)
- func (l *DoublyLinkedList) RPop(count int64) [][]byte
- func (l *DoublyLinkedList) RPush(data ...[]byte)
- func (l *DoublyLinkedList) RPushX(data []byte) int64
- func (l *DoublyLinkedList) SetValue(list [][]byte)
- func (l *DoublyLinkedList) Type() ds.DataType
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DoublyLinkedList ¶
type DoublyLinkedList struct {
// contains filtered or unexported fields
}
func NewDoublyLinkedList ¶
func NewDoublyLinkedList() *DoublyLinkedList
NewDoublyLinkedList returns a new doubly linked list
func (*DoublyLinkedList) GetValue ¶ added in v1.2.0
func (l *DoublyLinkedList) GetValue() [][]byte
GetValue returns the byte slice of the list
func (*DoublyLinkedList) LIndex ¶
func (l *DoublyLinkedList) LIndex(index int64) []byte
LIndex returns the element at index in the list
func (*DoublyLinkedList) LInsert ¶
func (l *DoublyLinkedList) LInsert(pivot, data []byte, before bool) int64
LInsert inserts the element before or after the pivot element
func (*DoublyLinkedList) LLen ¶
func (l *DoublyLinkedList) LLen() int64
LLen returns the length of the list
func (*DoublyLinkedList) LPop ¶
func (l *DoublyLinkedList) LPop(count int64) [][]byte
LPop returns the first element of the list
func (*DoublyLinkedList) LPush ¶
func (l *DoublyLinkedList) LPush(data ...[]byte)
LPush adds an element to the head of the list
func (*DoublyLinkedList) LPushX ¶
func (l *DoublyLinkedList) LPushX(data []byte) int64
LPushX adds an element to the head of the list if the list exists
func (*DoublyLinkedList) LRange ¶
func (l *DoublyLinkedList) LRange(start, end int64) [][]byte
LRange returns a range of elements from the list
func (*DoublyLinkedList) LRem ¶
func (l *DoublyLinkedList) LRem(count int64, value []byte) int64
LRem removes the first count occurrences of elements equal to value from the list
func (*DoublyLinkedList) LSet ¶
func (l *DoublyLinkedList) LSet(index int64, value []byte) bool
LSet sets the list element at index to value
func (*DoublyLinkedList) LTrim ¶
func (l *DoublyLinkedList) LTrim(start, end int64)
LTrim trims an existing list so that it will contain only the specified range of elements specified
func (*DoublyLinkedList) RPop ¶
func (l *DoublyLinkedList) RPop(count int64) [][]byte
RPop returns the last element of the list
func (*DoublyLinkedList) RPush ¶
func (l *DoublyLinkedList) RPush(data ...[]byte)
RPush adds an element to the end of the list
func (*DoublyLinkedList) RPushX ¶
func (l *DoublyLinkedList) RPushX(data []byte) int64
RPushX adds an element to the end of the list if the list exists
func (*DoublyLinkedList) SetValue ¶ added in v1.2.0
func (l *DoublyLinkedList) SetValue(list [][]byte)
SetValue restores the list from the byte slice
func (*DoublyLinkedList) Type ¶ added in v1.2.0
func (l *DoublyLinkedList) Type() ds.DataType
Type returns the type of the data structure