Documentation ¶
Index ¶
- func NewLogAdapter(cfg config.LogConfig) (adapters.LogAdapterInterface, error)
- func NewMySQLAdapter(cfg config.DBConfig) (adapters.DBAdapterInterface, error)
- func NewMySQLTxAdapter(dba adapters.DBAdapterInterface) adapters.DBTxAdapterInterface
- func NewPostgresAdapter(cfg config.DBConfig) (adapters.DBAdapterInterface, error)
- func NewPostgresTxAdapter(dba adapters.DBAdapterInterface) adapters.DBTxAdapterInterface
- type LogAdapter
- func (a *LogAdapter) Debug(ctx context.Context, message string, options ...interface{})
- func (a *LogAdapter) Destruct()
- func (a *LogAdapter) Error(ctx context.Context, message string, options ...interface{})
- func (a *LogAdapter) Info(ctx context.Context, message string, options ...interface{})
- func (a *LogAdapter) Warn(ctx context.Context, message string, options ...interface{})
- type MySQLAdapter
- type MySQLTxAdapter
- type PostgresAdapter
- type PostgresTxAdapter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLogAdapter ¶
func NewLogAdapter(cfg config.LogConfig) (adapters.LogAdapterInterface, error)
NewLogAdapter creates a new Log adapter instance.
func NewMySQLAdapter ¶ added in v1.5.0
func NewMySQLAdapter(cfg config.DBConfig) (adapters.DBAdapterInterface, error)
NewMySQLAdapter creates a new MySQL adapter instance.
func NewMySQLTxAdapter ¶ added in v1.5.0
func NewMySQLTxAdapter(dba adapters.DBAdapterInterface) adapters.DBTxAdapterInterface
NewPostgresTxAdapter creates a new Postgres transaction adapter instance.
func NewPostgresAdapter ¶
func NewPostgresAdapter(cfg config.DBConfig) (adapters.DBAdapterInterface, error)
NewPostgresAdapter creates a new Postgres adapter instance.
func NewPostgresTxAdapter ¶
func NewPostgresTxAdapter(dba adapters.DBAdapterInterface) adapters.DBTxAdapterInterface
NewPostgresTxAdapter creates a new Postgres transaction adapter instance.
Types ¶
type LogAdapter ¶
type LogAdapter struct {
// contains filtered or unexported fields
}
LogAdapter is used to provide structured log messages.
func (*LogAdapter) Debug ¶
func (a *LogAdapter) Debug(ctx context.Context, message string, options ...interface{})
Debug logs a message as of debug type.
func (*LogAdapter) Destruct ¶
func (a *LogAdapter) Destruct()
Destruct will close the logger gracefully releasing all resources.
func (*LogAdapter) Error ¶
func (a *LogAdapter) Error(ctx context.Context, message string, options ...interface{})
Error logs a message as of error type.
type MySQLAdapter ¶ added in v1.5.0
type MySQLAdapter struct {
// contains filtered or unexported fields
}
MySQLAdapter is used to communicate with a MySQL/MariaDB databases.
func (*MySQLAdapter) Destruct ¶ added in v1.5.0
func (a *MySQLAdapter) Destruct()
Destruct will close the MySQL adapter releasing all resources.
func (*MySQLAdapter) NewTransaction ¶ added in v1.5.0
func (a *MySQLAdapter) NewTransaction() (*sql.Tx, error)
NewTransaction creates a new database transaction.
type MySQLTxAdapter ¶ added in v1.5.0
type MySQLTxAdapter struct {
// contains filtered or unexported fields
}
MySQLTxAdapter is used to handle postgres db transactions.
type PostgresAdapter ¶
type PostgresAdapter struct {
// contains filtered or unexported fields
}
PostgresAdapter is used to communicate with a Postgres database.
func (*PostgresAdapter) Destruct ¶
func (a *PostgresAdapter) Destruct()
Destruct will close the Postgres adapter releasing all resources.
func (*PostgresAdapter) NewTransaction ¶
func (a *PostgresAdapter) NewTransaction() (*sql.Tx, error)
NewTransaction creates a new database transaction.
type PostgresTxAdapter ¶
type PostgresTxAdapter struct {
// contains filtered or unexported fields
}
PostgresTxAdapter is used to handle postgres db transactions.