wal

package
v0.0.0-...-b92c3bc Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderMagic = "lblog\x31\x41\x59"
	FooterMagic = "footer\x31\x41"
)
View Source
const (
	MaxWriteSize = 1 << 22
)

Variables

View Source
var (
	ErrUnexpectedEOF = io.ErrUnexpectedEOF
	ErrCorruptedLog  = errors.New("wal: log corrupted")
)
View Source
var (
	ErrWriteTooBig  = errors.New("wal: write size too big")
	ErrWriterClosed = errors.New("wal: writer closed")
)

Functions

This section is empty.

Types

type LogFile

type LogFile interface {
	io.Writer
	io.ReaderAt
}

type ReadableLog

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

func NewReadableLog

func NewReadableLog(lf LogFile) *ReadableLog

func (*ReadableLog) CloseWriter

func (w *ReadableLog) CloseWriter() error

func (*ReadableLog) NextData

func (w *ReadableLog) NextData(off int64) (int64, error)

func (*ReadableLog) NextHole

func (w *ReadableLog) NextHole(off int64) (int64, error)

func (*ReadableLog) ReadAt

func (w *ReadableLog) ReadAt(p []byte, off int64) (int, error)

func (*ReadableLog) Trim

func (w *ReadableLog) Trim(off, length int64) error

func (*ReadableLog) WriteAt

func (w *ReadableLog) WriteAt(p []byte, off int64) (int, error)

func (*ReadableLog) Written

func (w *ReadableLog) Written() int64

type Reader

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

func NewReader

func NewReader(ra io.ReaderAt, size int64) (*Reader, error)

func (*Reader) NextData

func (r *Reader) NextData(off int64) (int64, error)

func (*Reader) NextHole

func (r *Reader) NextHole(off int64) (int64, error)

func (*Reader) ReadAt

func (r *Reader) ReadAt(b []byte, off int64) (int, error)

func (*Reader) Size

func (r *Reader) Size() int64

type Writer

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

func NewWriter

func NewWriter(w io.Writer) *Writer

func (*Writer) CloseWriter

func (w *Writer) CloseWriter() error

func (*Writer) LogSize

func (w *Writer) LogSize() int64

func (*Writer) NextData

func (w *Writer) NextData(off int64) (int64, error)

func (*Writer) NextHole

func (w *Writer) NextHole(off int64) (int64, error)

func (*Writer) ReadAtFrom

func (w *Writer) ReadAtFrom(r io.ReaderAt, b []byte, off int64) (int, error)

func (*Writer) Size

func (w *Writer) Size() int64

func (*Writer) Trim

func (w *Writer) Trim(off, length int64) error

func (*Writer) WriteAt

func (w *Writer) WriteAt(p []byte, off int64) (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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