contrib

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRedisConnectionTimeout = errors.New("ERR_REDIS_CONNECTION_TIMEOUT")
)

Functions

func NewEtcdClient

func NewEtcdClient(endpoints []string) (*clientv3.Client, error)

NewEtcdClient ... 根据 endpoints 创建 etcd client(v3)

func NewGorm

func NewGorm(c DataConf, ctxlog *log.Helper) (*gorm.DB, error)

NewGorm 创建 gorm 连接 Deprecated: please use bt.baishancloud.com/resdev/contrib/gorm.NewGorm()

func NewRedis

func NewRedis(c RedisConf, ctxlog *log.Helper) (*redis.Client, error)

NewRedis ... 创建一个 Redis 实例

Types

type DataConf

type DataConf interface {
	GetDriver() string
	GetSource() string
	// GetDebug ... alias IsDebug()
	GetDebug() bool
}

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 (*GormLogger) Trace

func (l *GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (*GormLogger) Warn

func (l *GormLogger) Warn(ctx context.Context, s string, args ...interface{})

type RedisConf

type RedisConf interface {
	GetAddr() string
	GetPassword() string
	GetSelectDb() int32
}

Directories

Path Synopsis
job
只为了测试xxljob配合链路追踪的日志输出,将zap封装成kratos log
只为了测试xxljob配合链路追踪的日志输出,将zap封装成kratos log

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL