bunzap

package
v0.0.0-...-4f82171 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperationFieldName     = "operation"
	OperationTimeFieldName = "operation_time_ms"
)

Field names

Variables

This section is empty.

Functions

This section is empty.

Types

type QueryHook

type QueryHook struct {
	bun.QueryHook
	// contains filtered or unexported fields
}

QueryHook defines the structure of our adapters hook it implements the bun.QueryHook interface

func NewQueryHook

func NewQueryHook(options QueryHookOptions) QueryHook

NewQueryHook returns a new adapters hook for use with uptrace/bun.

func (QueryHook) AfterQuery

func (qh QueryHook) AfterQuery(ctx context.Context, event *bun.QueryEvent)

func (QueryHook) BeforeQuery

func (qh QueryHook) BeforeQuery(ctx context.Context, event *bun.QueryEvent) context.Context

type QueryHookOptions

type QueryHookOptions struct {
	Logger       *zap.Logger
	SlowDuration time.Duration
}

QueryHookOptions defines the available options for a new adapters hook.

Jump to

Keyboard shortcuts

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