Documentation ¶
Index ¶
- Constants
- Variables
- type Option
- type Target
- func (t *Target) Add(migration migrations.Migration) error
- func (t *Target) Create() error
- func (t *Target) Current() (migrations.Migration, error)
- func (t *Target) Destroy() error
- func (t *Target) Done() ([]migrations.Migration, error)
- func (t *Target) Lock() (migrations.Unlocker, error)
- func (t *Target) Remove(migration migrations.Migration) error
Constants ¶
View Source
const DefaultMigrationsCollectionName = "_migrations"
DefaultMigrationsCollectionName is the default collection name to be used to store the migrations.
Variables ¶
View Source
var ( ErrMissingSource = errors.New("source is required") ErrLockTimeout = errors.New("timeout while trying to lock the database") )
View Source
var ( // DefaultLockTimeout is the default timeout to be used when trying to lock the database. DefaultLockTimeout = 10 * time.Second )
View Source
var ( // DefaultOperationTimeout is the default timeout to be used when performing operations in the database. Eg; Add the // migration document to the collection. DefaultOperationTimeout = 10 * time.Second )
Functions ¶
This section is empty.
Types ¶
type Option ¶
func CollectionName ¶
CollectionName sets the collection name to be used to store the migrations. The default value is stored in the global variable DefaultMigrationsCollectionName.
func LockTimeout ¶
LockTimeout sets the timeout to be used when trying to lock the database. The default value is read from DefaultLockTimeout.
func OperationTimeout ¶
OperationTimeout sets the timeout to be used when performing operations in the database. The default value is read from DefaultOperationTimeout.
Click to show internal directories.
Click to hide internal directories.