btmigrate

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	Perform(*bigtable.AdminClient) error
	HumanOutput() string
}

type CreateFamiliesDefinition

type CreateFamiliesDefinition map[string]GCDefinition

type CreateFamily

type CreateFamily struct {
	Table  string
	Family string
}

func (CreateFamily) HumanOutput

func (c CreateFamily) HumanOutput() string

func (CreateFamily) Perform

func (c CreateFamily) Perform(admin *bigtable.AdminClient) error

type CreateTable

type CreateTable struct {
	Table    string
	Families map[string]bigtable.GCPolicy
}

func (CreateTable) HumanOutput

func (c CreateTable) HumanOutput() string

func (CreateTable) Perform

func (c CreateTable) Perform(admin *bigtable.AdminClient) error

type CreateTablesDefinition

type CreateTablesDefinition map[string]CreateFamiliesDefinition

type DeleteFamily

type DeleteFamily struct {
	Table  string
	Family string
}

func (DeleteFamily) HumanOutput

func (d DeleteFamily) HumanOutput() string

func (DeleteFamily) Perform

func (d DeleteFamily) Perform(admin *bigtable.AdminClient) error

type DropTable

type DropTable struct {
	Table string
}

func (DropTable) HumanOutput

func (d DropTable) HumanOutput() string

func (DropTable) Perform

func (d DropTable) Perform(admin *bigtable.AdminClient) error

type GCDefinition

type GCDefinition struct {
	MaxVersions int          `toml:"max-versions"`
	MaxAge      TomlDuration `toml:"max-age"`
}

type MigrationDefinition

type MigrationDefinition struct {
	Create CreateTablesDefinition `toml:"create"`
	Drop   map[string]struct{}    `toml:"drop"`
}

func LoadDefinition

func LoadDefinition(input string) (MigrationDefinition, error)

func LoadDefinitionFile

func LoadDefinitionFile(path string) (MigrationDefinition, error)

type Migrator

type Migrator struct {
	AdminClient *bigtable.AdminClient
}

func (*Migrator) Apply

func (m *Migrator) Apply(actions ...Action) error

func (*Migrator) Plan

func (m *Migrator) Plan(def MigrationDefinition) ([]Action, error)

func (*Migrator) Tables

func (m *Migrator) Tables() (map[string]map[string]string, error)

type SetGCPolicy

type SetGCPolicy struct {
	Table  string
	Family string
	Policy bigtable.GCPolicy
}

func (SetGCPolicy) HumanOutput

func (s SetGCPolicy) HumanOutput() string

func (SetGCPolicy) Perform

func (s SetGCPolicy) Perform(admin *bigtable.AdminClient) error

type TomlDuration

type TomlDuration time.Duration

func (*TomlDuration) UnmarshalText

func (d *TomlDuration) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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