Documentation ¶
Index ¶
- Variables
- func NewEtcdClient(endpoints []string) (*clientv3.Client, error)
- func NewGorm(c DataConf, ctxlog *log.Helper) (*gorm.DB, error)
- func NewRedis(c RedisConf, ctxlog *log.Helper) (*redis.Client, error)
- type DataConf
- type GormLogger
- func (l *GormLogger) Error(ctx context.Context, s string, args ...interface{})
- func (l *GormLogger) Info(ctx context.Context, s string, args ...interface{})
- func (l *GormLogger) LogMode(level gormLogger.LogLevel) gormLogger.Interface
- func (l *GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l *GormLogger) Warn(ctx context.Context, s string, args ...interface{})
- type RedisConf
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrRedisConnectionTimeout = errors.New("ERR_REDIS_CONNECTION_TIMEOUT")
)
Functions ¶
func NewEtcdClient ¶
NewEtcdClient ... 根据 endpoints 创建 etcd client(v3)
Types ¶
type GormLogger ¶
type GormLogger struct { SlowThreshold time.Duration SourceField string SkipCallerLookup bool SkipErrRecordNotFound bool // contains filtered or unexported fields }
func NewGormLogger ¶
func NewGormLogger(dbLog *log.Helper, hasDebug bool) *GormLogger
func (*GormLogger) Error ¶
func (l *GormLogger) Error(ctx context.Context, s string, args ...interface{})
func (*GormLogger) Info ¶
func (l *GormLogger) Info(ctx context.Context, s string, args ...interface{})
func (*GormLogger) LogMode ¶
func (l *GormLogger) LogMode(level gormLogger.LogLevel) gormLogger.Interface
Click to show internal directories.
Click to hide internal directories.