Documentation ¶
Index ¶
- func GetDb() *gorm.DB
- func GetDbByName(name string) *gorm.DB
- func InitDataSource(dbConfigs map[string]config.DBConfig)
- func NewLogger(log *logger.AppLogger, config glog.Config, zapFields ...zap.Field) glog.Interface
- func NewSkyWalkingPlugin(opts ...applyOption) gorm.Plugin
- func WithErrorTagHook(errorTagHook errorTagHook) applyOption
- func WithLogResult(logResult bool) applyOption
- func WithSqlParameters(logSqlParameters bool) applyOption
- func WithTracer(tracer *go2sky.Tracer) applyOption
- func WithUrl(url string) applyOption
- type Logger
- func (l Logger) Error(ctx context.Context, msg string, data ...interface{})
- func (l Logger) Info(ctx context.Context, msg string, data ...interface{})
- func (l *Logger) LogMode(level glog.LogLevel) glog.Interface
- func (l Logger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l Logger) Warn(ctx context.Context, msg string, data ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitDataSource ¶
InitDataSource 初始化db
func NewSkyWalkingPlugin ¶
New constructs a new plugin based opentracing. It supports to trace all operations in gorm, so if you have already traced your servers, now this plugin will perfect your tracing job.
func WithErrorTagHook ¶
func WithErrorTagHook(errorTagHook errorTagHook) applyOption
func WithLogResult ¶
func WithLogResult(logResult bool) applyOption
WithLogResult enable opentracingPlugin to log the result of each executed sql.
func WithSqlParameters ¶
func WithSqlParameters(logSqlParameters bool) applyOption
func WithTracer ¶
WithTracer allows to use customized tracer rather than the global one only.
Types ¶
Click to show internal directories.
Click to hide internal directories.