Documentation ¶
Index ¶
- Variables
- type Code
- type Config
- type MetricCollector
- type MetricsHook
- type ReconnectHook
- type SimplerrHook
- type TracingHook
- func (hook *TracingHook) After(ctx context.Context, input *dbhook.HookInput) (context.Context, error)
- func (hook *TracingHook) Before(ctx context.Context, input *dbhook.HookInput) (context.Context, error)
- func (hook *TracingHook) Error(ctx context.Context, input *dbhook.HookInput) (context.Context, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCanRetry = errors.New("connection reconnect")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ReconnectFn func() error Addr string User string Database string CertPath string Type string ReadTimeout string WriteTimeout string DataSourceName string DriverName string Instance string }
Config is internal hook config with specified information.
type MetricCollector ¶ added in v0.5.0
type MetricsHook ¶ added in v0.5.0
type MetricsHook struct {
// contains filtered or unexported fields
}
func NewMetricsHook ¶ added in v0.5.0
func NewMetricsHook(config *Config, collector MetricCollector) *MetricsHook
type ReconnectHook ¶
type ReconnectHook struct {
// contains filtered or unexported fields
}
func NewReconnectHook ¶
func NewReconnectHook(config *Config) *ReconnectHook
type SimplerrHook ¶
type SimplerrHook struct{}
func NewSimplerrHook ¶
func NewSimplerrHook() *SimplerrHook
type TracingHook ¶
type TracingHook struct {
// contains filtered or unexported fields
}
func NewTracingHook ¶
func NewTracingHook(tracer trace.Tracer, config *Config) *TracingHook
Click to show internal directories.
Click to hide internal directories.