versioned

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0, MIT Imports: 6 Imported by: 21

Documentation

Overview

Package versioned provides an interface for defining versioned migrations -- migrations that move records from one versioned namespace to another withing go datastore

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInitialVersionedMigration

func NewInitialVersionedMigration(datastoreMigration versioning.DatastoreMigration, newVersion versioning.VersionKey) versioning.VersionedMigration

NewInitialVersionedMigration sets up a migration that starts from an unversioned datastore

func NewVersionedMigration

func NewVersionedMigration(datastoreMigration versioning.DatastoreMigration, oldVersion versioning.VersionKey, newVersion versioning.VersionKey) versioning.VersionedMigration

NewVersionedMigration converts a datastore migration to a versioned migration with the given old and new versions

Types

type Builder

type Builder interface {
	Reversible(down versioning.MigrationFunc) Builder
	FilterKeys([]string) Builder
	Only([]string) Builder
	OldVersion(versioning.VersionKey) Builder
	Build() (versioning.VersionedMigration, error)
}

Builder is just a versioned version of the migration builder

func NewVersionedBuilder

func NewVersionedBuilder(up versioning.MigrationFunc, newVersion versioning.VersionKey) Builder

NewVersionedBuilder returns a new versioned builder for the given migration function

type BuilderList

type BuilderList []Builder

BuilderList is a list of versioned builders that can be built into a single command to a VersionedMigrationList

func (BuilderList) Build

Build creates a VersionedMigrationList from a list of VersionedBuilders in a single step

Jump to

Keyboard shortcuts

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