simplewal

package
v0.0.0-...-bd4e2c0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Overview

Package simplewal is a basic WAL implementation meant to be the first 'real' WAL option for mirbft. More sophisticated WALs with checksums, byte alignments, etc. may be produced in the future, but this is just a simple place to start.

Index

Constants

This section is empty.

Variables

View Source
var File_simplewal_simplewal_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type WAL

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

func Open

func Open(path string) (*WAL, error)

func (*WAL) Append

func (w *WAL) Append(event *eventpb.Event, retentionIndex t.WALRetIndex) error

func (*WAL) Close

func (w *WAL) Close() error

func (*WAL) IsEmpty

func (w *WAL) IsEmpty() (bool, error)

func (*WAL) LoadAll

func (w *WAL) LoadAll(forEach func(index t.WALRetIndex, p *eventpb.Event)) error

func (*WAL) Sync

func (w *WAL) Sync() error

func (*WAL) Truncate

func (w *WAL) Truncate(retentionIndex t.WALRetIndex) error

type WALEntry

type WALEntry struct {
	RetentionIndex uint64         `protobuf:"varint,1,opt,name=retention_index,json=retentionIndex,proto3" json:"retention_index,omitempty"`
	Event          *eventpb.Event `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"`
	// contains filtered or unexported fields
}

func (*WALEntry) Descriptor deprecated

func (*WALEntry) Descriptor() ([]byte, []int)

Deprecated: Use WALEntry.ProtoReflect.Descriptor instead.

func (*WALEntry) GetEvent

func (x *WALEntry) GetEvent() *eventpb.Event

func (*WALEntry) GetRetentionIndex

func (x *WALEntry) GetRetentionIndex() uint64

func (*WALEntry) ProtoMessage

func (*WALEntry) ProtoMessage()

func (*WALEntry) ProtoReflect

func (x *WALEntry) ProtoReflect() protoreflect.Message

func (*WALEntry) Reset

func (x *WALEntry) Reset()

func (*WALEntry) String

func (x *WALEntry) String() string

Jump to

Keyboard shortcuts

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