list

package
v1.1.0-beta.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DoublyLinkedList

type DoublyLinkedList struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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

type Node

type Node struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL