filequeue

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const FileMaxSize int64 = 16 * 1024 * 1024

Variables

View Source
var QueueMap map[string]*Queue

Functions

func BytesToInt32

func BytesToInt32(b []byte) int32

func Delete

func Delete(path string)

func Int32ToBytes

func Int32ToBytes(n int32) []byte

Types

type FileInfo

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

type Queue

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

func NewQueue

func NewQueue(path string) *Queue

func (*Queue) Ack

func (This *Queue) Ack(n int) (e error)

ack 消息数量

func (*Queue) Append

func (This *Queue) Append(content string) error

func (*Queue) AppendBytes

func (This *Queue) AppendBytes(b []byte) error

func (*Queue) GetInfo

func (This *Queue) GetInfo() QueueInfo

func (*Queue) Pop

func (This *Queue) Pop() (content []byte, e error)

func (*Queue) ReadLast

func (This *Queue) ReadLast() (content []byte, e error)

获取最后一条数据

type QueueInfo

type QueueInfo struct {
	sync.RWMutex
	MinId         int64           // 最小文件
	MaxId         int64           // 当前最大文件,当 -1 的时候,代表整个目录为空
	Path          string          // 文件夹路径
	FileCount     int             // 文件数量
	UnackFileList []UnackFileInfo // 已加载到内存的文件信息
}

type UnackFileInfo

type UnackFileInfo struct {
	Id          int64 // 文件编号
	UnackCount  int   // unack 数量
	AllInMemory bool  // 全部数据已经加载到内存
	TotalCount  int   // 整个文件已经加载到内存消息条数
}

Jump to

Keyboard shortcuts

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