Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBMigration ¶
type DBMigration struct { Up DBMigrationFunction Down DBMigrationFunction }
DBMigration contains two functions, Up and Down that together perform and undo a set of changes to the database.
type DBMigrationFunction ¶
DBMigrationFunction gives the signature of functions that can perform database migrations.
type ManagedDB ¶
ManagedDB has all information pertaining to the database that is being managed. This should probably all be opaque to the user.
func NewManagedDB ¶
func NewManagedDB(dbPath string, driver string, migrations map[int]DBMigration) *ManagedDB
NewManagedDB creates and initializes a new ManagedDB with the given file path, datatbase driver and migrations to apply to the db.
func (ManagedDB) DoWrite ¶
func (mdb ManagedDB) DoWrite(writeFunc ManagedDBWriteFunc) error
DoWrite executes the provided ManagedDBWriteFunc in a safely single-threaded way. All writes to the underlying DB should happen in this way.
type ManagedDBWriteFunc ¶
Click to show internal directories.
Click to hide internal directories.