queue

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBSet

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

DBSet 数据库设置

type Instance

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

Instance 实例

func GetDBInstance

func GetDBInstance(dbName string) *Instance

GetDBInstance 获取实例

func (*Instance) DisplayQueue

func (instance *Instance) DisplayQueue()

DisplayQueue 打印队列信息

func (*Instance) FlushDB

func (instance *Instance) FlushDB() error

FlushDB 删除数据库

警告:此操作后,当前实例将被销毁,若继续调用,将会panic

如:

instance := queue.GetDBInstance("db1")

instance.FlushDB()

instance.LPush(1) # <- 此处将会panic

func (*Instance) GetDBList

func (instance *Instance) GetDBList() []string

GetDBList 获取当前数据库

func (*Instance) GetSize

func (instance *Instance) GetSize() uint

GetSize 获取当前队列长度

func (*Instance) LPop

func (instance *Instance) LPop() (interface{}, error)

LPop 从队列头部返回节点值

func (*Instance) LPush

func (instance *Instance) LPush(val interface{}) error

LPush 向队列头部添加节点

func (*Instance) RPop

func (instance *Instance) RPop() (interface{}, error)

RPop 从队列尾部弹出节点值

func (*Instance) RPush

func (instance *Instance) RPush(val interface{}) error

RPush 向队列尾部追加节点

func (*Instance) SetDebugMode added in v0.0.5

func (instance *Instance) SetDebugMode(isDebug bool) *Instance

SetDebugMode 设置调试模式

Jump to

Keyboard shortcuts

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