backlog

package
v0.0.0-...-13a9703 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BuffSizeAlign = 1024 * 4
)
View Source
const (
	FileSizeAlign = 1024 * 1024 * 4
)

Variables

View Source
var (
	ErrClosedBacklog = errors.New("closed backlog")
	ErrInvalidOffset = errors.New("invalid offset")
)

Functions

This section is empty.

Types

type Backlog

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

func New

func New() *Backlog

func NewFileBacklog

func NewFileBacklog(fileSize int, f *os.File) *Backlog

func NewSize

func NewSize(buffSize int) *Backlog

func (*Backlog) Close

func (bl *Backlog) Close() error

func (*Backlog) CloseWithError

func (bl *Backlog) CloseWithError(err error) error

func (*Backlog) DataRange

func (bl *Backlog) DataRange() (rpos, wpos uint64, err error)

func (*Backlog) NewReader

func (bl *Backlog) NewReader() (*Reader, error)

func (*Backlog) ReadAt

func (bl *Backlog) ReadAt(b []byte, offset uint64) (int, error)

func (*Backlog) Write

func (bl *Backlog) Write(b []byte) (int, error)

type Reader

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

func (*Reader) DataRange

func (r *Reader) DataRange() (rpos, wpos uint64, err error)

func (*Reader) IsValid

func (r *Reader) IsValid() bool

func (*Reader) Offset

func (r *Reader) Offset() uint64

func (*Reader) Read

func (r *Reader) Read(b []byte) (int, error)

func (*Reader) SeekTo

func (r *Reader) SeekTo(seek uint64) bool

Jump to

Keyboard shortcuts

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