storage

package
v0.0.0-...-ed33083 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitLog

type CommitLog struct {
	Logs []Log
	// contains filtered or unexported fields
}

func LoadCommitLogFromFile

func LoadCommitLogFromFile() (*CommitLog, error)

func NewCommitLog

func NewCommitLog() *CommitLog

func (*CommitLog) Append

func (c *CommitLog) Append(data []byte) int64

func (*CommitLog) GetNextOffset

func (c *CommitLog) GetNextOffset() int64

func (*CommitLog) PersistToDiskLoop

func (c *CommitLog) PersistToDiskLoop()

func (*CommitLog) Read

func (c *CommitLog) Read(offset int64) []byte

func (*CommitLog) SaveToFile

func (c *CommitLog) SaveToFile() error

Saving CommitLog to Disk

type CommitLogData

type CommitLogData struct {
	Logs       []Log
	NextOffset int64
}

type Log

type Log struct {
	Offset int64
	Data   []byte
}

Jump to

Keyboard shortcuts

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