simplewal

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package simplewal is a basic WAL implementation meant to be the first 'real' WAL option for mir. 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.RetentionIndex) error

func (*WAL) ApplyEvent

func (w *WAL) ApplyEvent(event *eventpb.Event) (*events.EventList, error)

func (*WAL) ApplyEvents

func (w *WAL) ApplyEvents(eventsIn *events.EventList) (*events.EventList, error)

func (*WAL) Close

func (w *WAL) Close() error

func (*WAL) ImplementsModule

func (w *WAL) ImplementsModule()

The ImplementsModule method only serves the purpose of indicating that this is a Module and must not be called.

func (*WAL) IsEmpty

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

func (*WAL) LoadAll

func (w *WAL) LoadAll(_ context.Context) (*events.EventList, error)

func (*WAL) Sync

func (w *WAL) Sync() error

func (*WAL) Truncate

func (w *WAL) Truncate(retentionIndex t.RetentionIndex) 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