Documentation ¶
Index ¶
- Constants
- func ComparePasswords(hashedPassword string, plainPassword string) bool
- func ConvertDuplicatedError(err error, newErr error) error
- func ConvertRelationError(err error, newErr error) error
- func HashPassword(password string) (string, error)
- func MetricsServerProcess(ctx context.Context, port int, gracefulShutdownTimeSec int) error
- func MigrateDB(db *gorm.DB, driverName string, sourceDriver source.Driver, ...) error
- func MigrateMySQLDB(db *gorm.DB, sqlFS fs.FS) error
- func MigratePostgresDB(db *gorm.DB, sqlFS fs.FS) error
- func MigrateSQLite3DB(db *gorm.DB, sqlFS fs.FS) error
- func NewNonTransactionManagerT[RF any](rf RF) (service.TransactionManagerT[RF], error)
- func NewTransactionManagerT[RF any](db *gorm.DB, rff func(ctx context.Context, db *gorm.DB) (RF, error)) (service.TransactionManagerT[RF], error)
- func OpenMySQL(cfg *MySQLConfig) (*gorm.DB, error)
- func OpenPostgres(cfg *PostgresConfig) (*gorm.DB, error)
- func OpenSQLite3(cfg *SQLite3Config) (*gorm.DB, error)
- func SignalWatchProcess(ctx context.Context) error
- type DialectMySQL
- type DialectPostgres
- type DialectRDBMS
- func InitMySQL(ctx context.Context, cfg *MySQLConfig, migration bool, fs fs.FS) (DialectRDBMS, *gorm.DB, *sql.DB, error)
- func InitPostgres(ctx context.Context, cfg *PostgresConfig, migration bool, fs fs.FS) (DialectRDBMS, *gorm.DB, *sql.DB, error)
- func InitSqlite3(ctx context.Context, cfg *SQLite3Config, migration bool, fs fs.FS) (DialectRDBMS, *gorm.DB, *sql.DB, error)
- type DialectSQLite3
- type MySQLConfig
- type PostgresConfig
- type SQLite3Config
Constants ¶
View Source
const MYSQL_ER_DUP_ENTRY = 1062
View Source
const MYSQL_ER_NO_REFERENCED_ROW_2 = 1452
View Source
const SQLITE_CONSTRAINT_PRIMARYKEY = 1555
View Source
const SQLITE_CONSTRAINT_UNIQUE = 2067
Variables ¶
This section is empty.
Functions ¶
func ComparePasswords ¶
func ConvertDuplicatedError ¶
func ConvertRelationError ¶
func HashPassword ¶
func MetricsServerProcess ¶
func NewNonTransactionManagerT ¶
func NewNonTransactionManagerT[RF any](rf RF) (service.TransactionManagerT[RF], error)
func NewTransactionManagerT ¶
func OpenPostgres ¶
func OpenPostgres(cfg *PostgresConfig) (*gorm.DB, error)
func OpenSQLite3 ¶
func OpenSQLite3(cfg *SQLite3Config) (*gorm.DB, error)
func SignalWatchProcess ¶
Types ¶
type DialectMySQL ¶
type DialectMySQL struct { }
func (*DialectMySQL) BoolDefaultValue ¶
func (d *DialectMySQL) BoolDefaultValue() string
func (*DialectMySQL) Name ¶
func (d *DialectMySQL) Name() string
type DialectPostgres ¶
type DialectPostgres struct { }
func (*DialectPostgres) BoolDefaultValue ¶
func (d *DialectPostgres) BoolDefaultValue() string
func (*DialectPostgres) Name ¶
func (d *DialectPostgres) Name() string
type DialectSQLite3 ¶
type DialectSQLite3 struct { }
func (*DialectSQLite3) BoolDefaultValue ¶
func (d *DialectSQLite3) BoolDefaultValue() string
func (*DialectSQLite3) Name ¶
func (d *DialectSQLite3) Name() string
type MySQLConfig ¶
type PostgresConfig ¶
type SQLite3Config ¶
type SQLite3Config struct {
File string `yaml:"file" validate:"required"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.