ipq

package
v0.0.0-...-f0a05f1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPQ

type IPQ interface {
	Len() int

	SpaceLeft() bool

	// PushBack push element to the back of the queue
	// if k exists and move is true, element will be move to back
	// if k exists and update is true, Value of element will be replaced
	PushBack(k, v interface{}, move, update bool)

	Get(k interface{}) interface{}

	Del(k interface{})

	Range(f func(*Item) bool)

	DelInRange(f func(*Item) (bool, bool))

	Reset()

	Free()
}

type Item

type Item struct {
	Key   interface{}
	Value interface{}
}

type MemoryIPQ

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

func NewMemoryIPQ

func NewMemoryIPQ(maxLen int, f func(interface{})) *MemoryIPQ

func (*MemoryIPQ) Del

func (m *MemoryIPQ) Del(k interface{})

func (*MemoryIPQ) DelInRange

func (m *MemoryIPQ) DelInRange(f func(*Item) (bool, bool))

func (*MemoryIPQ) Free

func (m *MemoryIPQ) Free()

func (*MemoryIPQ) Get

func (m *MemoryIPQ) Get(k interface{}) interface{}

func (*MemoryIPQ) Len

func (m *MemoryIPQ) Len() int

func (*MemoryIPQ) List

func (m *MemoryIPQ) List() *list.List

func (*MemoryIPQ) PushBack

func (m *MemoryIPQ) PushBack(k, v interface{}, move, update bool)

func (*MemoryIPQ) Range

func (m *MemoryIPQ) Range(f func(*Item) bool)

func (*MemoryIPQ) Reset

func (m *MemoryIPQ) Reset()

func (*MemoryIPQ) SpaceLeft

func (m *MemoryIPQ) SpaceLeft() bool

Jump to

Keyboard shortcuts

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