utils

package
v0.0.0-...-d9650e1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SyncInterval  = 200 * time.Millisecond
	SegmentPrefix = "segment-"
)

Variables

This section is empty.

Functions

func CreateSegmentFile

func CreateSegmentFile(directory string, segmentId int) (*os.File, error)

creates new segment file with given id in provided directory and returns it

func FindLastSegmentId

func FindLastSegmentId(files []string) (uint, error)

finds last segment id in the list of files

func MustMarshal

func MustMarshal(entry *types.WAL_Entry) []byte

func MustUnmarshal

func MustUnmarshal(data []byte, entry *types.WAL_Entry)

func UnmarshalAndVerifyEntry

func UnmarshalAndVerifyEntry(data []byte) (*types.WAL_Entry, error)

unmarshals the given data into wal entry also verifies CRC32, returns only if it is valid

Types

This section is empty.

Jump to

Keyboard shortcuts

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