Documentation
¶
Index ¶
- func ApplyOptions(opt *option, fns ...Option)
- func Init(dbName string, dbConfig *Config, isDebug bool) error
- func RegistryDriver(name string, driver Driver)
- type BaseDb
- type ClickhouseDriver
- type Config
- type Driver
- type Logger
- func (l *Logger) Error(ctx context.Context, s string, i ...interface{})
- func (l *Logger) Info(ctx context.Context, s string, i ...interface{})
- func (l *Logger) LogMode(level grrmLogger.LogLevel) grrmLogger.Interface
- func (l *Logger) Trace(ctx context.Context, begin time.Time, ...)
- func (l *Logger) Warn(ctx context.Context, s string, i ...interface{})
- type MysqlDriver
- type Option
- type PostgreSqlDriver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyOptions ¶
func ApplyOptions(opt *option, fns ...Option)
func RegistryDriver ¶
Types ¶
type ClickhouseDriver ¶
type ClickhouseDriver struct{}
type Config ¶
type Config struct {
Driver string `json:"driver" yaml:"driver" validate:"required"`
Host string `json:"host" yaml:"host" validate:"required"`
Database string `json:"database" yaml:"database" validate:"required"`
Port int `json:"port" yaml:"port" validate:"required"`
Username string `json:"username" yaml:"username" validate:"required"`
Password string `json:"password" yaml:"password" validate:"required"`
MaxIdleConnes int `json:"max_idle_connes" yaml:"max_idle_connes" validate:"required"`
MaxOpenConnes int `json:"max_open_connes" yaml:"max_open_connes" validate:"required"`
MaxLifetime int `json:"max_lifetime" yaml:"max_lifetime" validate:"required"`
WriteTimeout time.Duration `json:"write_timeout" yaml:"write_timeout" validate:"required"`
ReadTimeout time.Duration `json:"read_timeout" yaml:"read_timeout" validate:"required"`
}
type Logger ¶
type Logger struct{}
func (*Logger) LogMode ¶
func (l *Logger) LogMode(level grrmLogger.LogLevel) grrmLogger.Interface
type MysqlDriver ¶
type MysqlDriver struct{}
type Option ¶
type Option interface {
Apply(opt *option)
}
func WithDebugLog ¶
func WithMaxIdleConn ¶
func WithMaxLifetime ¶
func WithMaxOpenConn ¶
type PostgreSqlDriver ¶
type PostgreSqlDriver struct{}
Click to show internal directories.
Click to hide internal directories.