file

package
v0.0.0-...-63e5ba4 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CRC32HashOffset int64 = 0
	CRC32HashSize   int64 = 4
	SkipAheadOffset       = CRC32HashOffset + CRC32HashSize
	SkipAheadSize   int64 = 8
	DataOffset            = SkipAheadOffset + SkipAheadSize
	HeadSize              = CRC32HashSize + SkipAheadSize
	MetaElementSize       = 2
)

Variables

View Source
var ConfigDefault = Config{
	Workspace:  "/tmp",
	MaxHistory: 3,
}

ConfigDefault is the default config

View Source
var (
	ErrInvalidFile = fmt.Errorf("file invalid")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Workspace  string
	MaxHistory int
}

Config defines the config for file queue.

type Queue

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

func NewQueue

func NewQueue(file *os.File, pattern Safe) (*Queue, error)

func NewQueueByModel

func NewQueueByModel(model ballistic.DataModel, config ...Config) (*Queue, error)

func (*Queue) Eject

func (f *Queue) Eject(limit int) (models []interface{}, err error)

func (*Queue) Len

func (f *Queue) Len() int

func (*Queue) Push

func (f *Queue) Push(model encoding.BinaryMarshaler) error

type Safe

Jump to

Keyboard shortcuts

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