Documentation ¶
Index ¶
- type DoublyLinkedList
- func (l *DoublyLinkedList) BLPop(timeout time.Duration) []byte
- func (l *DoublyLinkedList) BRPop(timeout time.Duration) []byte
- func (l *DoublyLinkedList) GetType() ds.DataType
- func (l *DoublyLinkedList) LIndex(index int) []byte
- func (l *DoublyLinkedList) LInsert(pivot, data []byte, before bool) int
- func (l *DoublyLinkedList) LLen() int
- func (l *DoublyLinkedList) LPop() []byte
- func (l *DoublyLinkedList) LPush(data ...[]byte)
- func (l *DoublyLinkedList) LPushX(data []byte) int
- func (l *DoublyLinkedList) LRange(start, end int) [][]byte
- func (l *DoublyLinkedList) LRem(count int, value []byte) int
- func (l *DoublyLinkedList) LSet(index int, value []byte) bool
- func (l *DoublyLinkedList) LTrim(start, end int)
- func (l *DoublyLinkedList) MarshalBinary() ([]byte, error)
- func (l *DoublyLinkedList) RPop() []byte
- func (l *DoublyLinkedList) RPush(data ...[]byte)
- func (l *DoublyLinkedList) RPushX(data []byte) int
- func (l *DoublyLinkedList) UnmarshalBinary(data []byte) error
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DoublyLinkedList ¶
func NewDoublyLinkedList ¶
func NewDoublyLinkedList() *DoublyLinkedList
NewDoublyLinkedList returns a new doubly linked list
func (*DoublyLinkedList) BLPop ¶
func (l *DoublyLinkedList) BLPop(timeout time.Duration) []byte
BLPop removes and returns the first element of the list
func (*DoublyLinkedList) BRPop ¶
func (l *DoublyLinkedList) BRPop(timeout time.Duration) []byte
BRPop removes and returns the last element of the list
func (*DoublyLinkedList) GetType ¶
func (l *DoublyLinkedList) GetType() ds.DataType
GetType returns the type of the data structure
func (*DoublyLinkedList) LIndex ¶
func (l *DoublyLinkedList) LIndex(index int) []byte
LIndex returns the element at index in the list
func (*DoublyLinkedList) LInsert ¶
func (l *DoublyLinkedList) LInsert(pivot, data []byte, before bool) int
LInsert inserts the element before or after the pivot element
func (*DoublyLinkedList) LLen ¶
func (l *DoublyLinkedList) LLen() int
LLen returns the length of the list
func (*DoublyLinkedList) LPop ¶
func (l *DoublyLinkedList) LPop() []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) int
LPushX adds an element to the head of the list if the list exists
func (*DoublyLinkedList) LRange ¶
func (l *DoublyLinkedList) LRange(start, end int) [][]byte
LRange returns a range of elements from the list
func (*DoublyLinkedList) LRem ¶
func (l *DoublyLinkedList) LRem(count int, value []byte) int
LRem removes the first count occurrences of elements equal to value from the list
func (*DoublyLinkedList) LSet ¶
func (l *DoublyLinkedList) LSet(index int, value []byte) bool
LSet sets the list element at index to value
func (*DoublyLinkedList) LTrim ¶
func (l *DoublyLinkedList) LTrim(start, end int)
LTrim trims an existing list so that it will contain only the specified range of elements specified
func (*DoublyLinkedList) MarshalBinary ¶ added in v1.0.8
func (l *DoublyLinkedList) MarshalBinary() ([]byte, error)
MarshalBinary returns the byte slice of the list
func (*DoublyLinkedList) RPop ¶
func (l *DoublyLinkedList) RPop() []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) int
RPushX adds an element to the end of the list if the list exists
func (*DoublyLinkedList) UnmarshalBinary ¶ added in v1.0.8
func (l *DoublyLinkedList) UnmarshalBinary(data []byte) error
UnmarshalBinary restores the list from the byte slice