persist

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Unlicense Imports: 9 Imported by: 0

Documentation

Overview

Package persist holds persistence functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AOF

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

AOF is Append Only File.

func OpenPersister

func OpenPersister(path string, syncIime int) (*AOF, map[string]map[int][]byte, error)

OpenPersister opens the append only file and reads in all the data.

func (*AOF) Close

func (aof *AOF) Close() error

Close stops the flush routine, flushes the last data to disk and closes the file.

func (*AOF) Defrag

func (aof *AOF) Defrag(keys map[string]map[int][]byte) (err error)

Defrag will only store the last key information, so all the history is lost This can mean a smaller filesize, which is quicker to read.

func (*AOF) Write

func (aof *AOF) Write(lines string) error

Write writes to the file.

Jump to

Keyboard shortcuts

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