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
- func NewValidatorAdapter() (adapters.ValidatorAdapterInterface, error)
- 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
- type ValidatorAdapter
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 ¶
func NewMySQLAdapter(cfg config.DBConfig) (adapters.DBAdapterInterface, error)
NewMySQLAdapter creates a new MySQL adapter instance.
func NewMySQLTxAdapter ¶
func NewMySQLTxAdapter(dba adapters.DBAdapterInterface) adapters.DBTxAdapterInterface
NewMySQLTxAdapter 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.
func NewValidatorAdapter ¶
func NewValidatorAdapter() (adapters.ValidatorAdapterInterface, error)
NewValidatorAdapter creates a new validator 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 ¶
type MySQLAdapter struct {
// contains filtered or unexported fields
}
MySQLAdapter is used to communicate with a MySQL/MariaDB databases.
func (*MySQLAdapter) Destruct ¶
func (a *MySQLAdapter) Destruct()
Destruct will close the MySQL adapter releasing all resources.
func (*MySQLAdapter) NewTransaction ¶
func (a *MySQLAdapter) NewTransaction() (*sql.Tx, error)
NewTransaction creates a new database transaction.
func (*MySQLAdapter) Ping ¶
func (a *MySQLAdapter) Ping() error
Ping checks whether the database is accessible.
type MySQLTxAdapter ¶
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.
func (*PostgresAdapter) Ping ¶
func (a *PostgresAdapter) Ping() error
Ping checks wether the database is accessible.
type PostgresTxAdapter ¶
type PostgresTxAdapter struct {
// contains filtered or unexported fields
}
PostgresTxAdapter is used to handle postgres db transactions.
type ValidatorAdapter ¶
type ValidatorAdapter struct {
// contains filtered or unexported fields
}
ValidatorAdapter is used to validate structures and variables against a set of validation rules.
func (*ValidatorAdapter) Validate ¶
func (a *ValidatorAdapter) Validate(data interface{}) map[string]string
Validate validates bound values of an unpacker struct against validation rules defined in that unpacker struct.
func (*ValidatorAdapter) ValidateField ¶
func (a *ValidatorAdapter) ValidateField(field interface{}, rules string) map[string]string
ValidateField validates a single variable.