entry

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch added in v0.2.0

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

Batch of entries.

func NewBatch added in v0.2.0

func NewBatch(capacity int) Batch

NewBatch with capacity.

func (*Batch) Append added in v0.2.0

func (b *Batch) Append(e Entry)

Append an entry.

func (*Batch) Len added in v0.2.0

func (b *Batch) Len() int

Len is number of entries inside Batch.

func (*Batch) Marshal added in v0.2.0

func (b *Batch) Marshal(w io.Writer, format common.EntryFormat) (code common.ErrCode, err error)

Marshal into writer.

func (*Batch) Reset added in v0.2.0

func (b *Batch) Reset()

Reset batch.

func (*Batch) ValidateSize added in v0.2.0

func (b *Batch) ValidateSize(size int) bool

ValidateSize checks size of entries.

type Entry

type Entry []byte

Entry represents queue entry.

func (*Entry) CloneFrom added in v0.1.2

func (e *Entry) CloneFrom(other Entry)

CloneFrom other entry.

func (Entry) Marshal

func (e Entry) Marshal(w io.Writer, format common.EntryFormat) (code common.ErrCode, err error)

Marshal writes entry to writer.

func (*Entry) Unmarshal

func (e *Entry) Unmarshal(r io.Reader, format common.EntryFormat) (common.ErrCode, int, error)

Unmarshal from reader.

type Reader

type Reader interface {
	io.Closer
	io.Seeker
	ReadEntry(*Entry) (common.ErrCode, int, error)
}

Reader interface.

type Writer

type Writer interface {
	io.Closer
	WriteEntry(Entry) (common.ErrCode, error)
	WriteBatch(Batch) (common.ErrCode, error)
}

Writer interface.

Jump to

Keyboard shortcuts

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