Documentation ¶
Index ¶
- func GetDBLogger(file io.Writer, ctx context.Context) logger.Interface
- func Setup(DBName, Location, User, Password, Port, logPath string)
- func Shut(DBName, Location, User, Password, Port, logPath string)
- type DBlogger
- func (l *DBlogger) Error(ctx context.Context, s string, args ...interface{})
- func (l *DBlogger) Info(ctx context.Context, s string, args ...interface{})
- func (l *DBlogger) LogMode(gormlogger.LogLevel) gormlogger.Interface
- func (l *DBlogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l *DBlogger) Warn(ctx context.Context, s string, args ...interface{})
- type Database
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DBlogger ¶
func NewDBLogger ¶
func NewDBLogger() *DBlogger
func (*DBlogger) LogMode ¶
func (l *DBlogger) LogMode(gormlogger.LogLevel) gormlogger.Interface
type Database ¶
type Database struct { Name string Location string User string Password string Port string Instance *gorm.DB // contains filtered or unexported fields }
Database stores the application data.
func GetWorkingInstance ¶
func GetWorkingInstance() *Database
GetWorkingInstance returns the current working instance of the DB. should be called only after database has been setup
func (*Database) MigrateSchema ¶
MigrateSchema Migrate DB schema for unit / api integration test code
Click to show internal directories.
Click to hide internal directories.