migrations

package
v2.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package migrations contains functions to run migrations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyV0ToV1

func ApplyV0ToV1(dir string, maxDatafileSize uint64) error

ApplyV0ToV1 applies the v0 to v1 migration to the given database by iterating over all datafiles in the given directory and rewriting them in the new format. The temp directory is used as a temporary location to write the new datafiles to. The maxDatafileSize parameter is used to split large datafiles into smaller ones.

func ApplyV1ToV2

func ApplyV1ToV2(dir string, maxDatafileSize uint64) error

ApplyV1ToV2 applies the v1 to v2 migration to the given database by iterating over all datafiles in the given directory and rewriting them in the new format. The temp directory is used as a temporary location to write the new datafiles to. The maxDatafileSize parameter is used to split large datafiles into smaller ones.

Types

type EntryV1

type EntryV1 struct {
	Checksum uint32
	Key      []byte
	Offset   int64
	Value    []byte
	Expiry   *time.Time
}

EntryV1 is a v1 entry

type EntryV2

type EntryV2 struct {
	Checksum uint32
	Key      []byte
	Value    []byte
}

EntryV2 is a v2 entry

Jump to

Keyboard shortcuts

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