etcd2

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2016 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine is a migration engine for an etcd v2 datastore.

func New

func New(prefix string, etcdHosts []string) *Engine

New creates a new etcd2 migration engine.

func (*Engine) CreateDirectory

func (e *Engine) CreateDirectory(target string) error

CreateDirectory creates a directory at the target path.

func (*Engine) CreateKey

func (e *Engine) CreateKey(target string, contents []byte) error

CreateKey will create a key at the target location.

func (*Engine) CurrentSchemaVersion

func (e *Engine) CurrentSchemaVersion() int64

CurrentSchemaVersion returns the version of the last migration which was successfully run. If no previous migrations have been run, the schema version is 0. If there's any error besides "key doesn't exist", execution is aborted.

func (*Engine) DeleteDirectory

func (e *Engine) DeleteDirectory(target string) error

DeleteDirectory will recursively delete a target directory.

func (*Engine) DeleteKey

func (e *Engine) DeleteKey(target string) error

DeleteKey will delete the target key if it exists.

func (*Engine) Name

func (e *Engine) Name() string

Name returns the name of the engine ("etcd2", "etcd3", "consul", etc.)

func (*Engine) UpdateSchemaVersion

func (e *Engine) UpdateSchemaVersion(newVersion int64) error

UpdateSchemaVersion records the version number of the latest migration which successfully ran. If the new version number is <= the current version number, it will log a fatal error.

Jump to

Keyboard shortcuts

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