Documentation ¶
Index ¶
- func GetDBConn(ctx context.Context, uri string, dbName string) (dbConn *mongo.Database, err error)
- func GetDBConnDefault(ctx context.Context) (dbConn *mongo.Database, err error)
- func Migrate(ctx context.Context, dbConn *mongo.Database) (err error)
- func Rollback(ctx context.Context, dbConn *mongo.Database) (err error)
- func Status(ctx context.Context, dbConn *mongo.Database) (err error)
- type MigrationInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDBConn ¶
func GetDBConn( ctx context.Context, uri string, dbName string, ) (dbConn *mongo.Database, err error)
Get DB connection instance
func GetDBConnDefault ¶
Get default DB connection instance
Types ¶
type MigrationInterface ¶
type MigrationInterface interface { // Get unique migration name. Name() (collectionName string) // Do the migration. Up(ctx context.Context, dbConn *mongo.Database) (err error) // Undo the migration. Down(ctx context.Context, dbConn *mongo.Database) (err error) }
Common migration functionalities.
Click to show internal directories.
Click to hide internal directories.