database

package
v3.0.0-prev0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const NilVersion int = -1

Variables

View Source
var (
	ErrLocked = fmt.Errorf("unable to acquire lock")
)

Functions

func Register

func Register(name string, driver Driver)

Types

type Driver

type Driver interface {
	Open(url string) (Driver, error)

	Close() error

	Lock() error

	Unlock() error

	// when version = NilVersion, "deinitialize"
	// migration can be nil, in that case, just store version
	Run(version int, migration io.Reader) error

	// version  > 0: regular version
	// version   -1: nil version (const NilVersion)
	// version < -1: will panic
	Version() (int, error)

	Drop() error
}

func Open

func Open(url string) (Driver, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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