database

package
v3.0.0-prev1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2017 License: MIT Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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