dbtracer

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDatabaseNameEmpty = errors.New("database name is empty")

Functions

This section is empty.

Types

type MockOption added in v1.3.0

type MockOption struct {
	mock.Mock
}

MockOption is an autogenerated mock type for the Option type

func NewMockOption added in v1.3.0

func NewMockOption(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockOption

NewMockOption creates a new instance of MockOption. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockOption) EXPECT added in v1.3.0

func (_m *MockOption) EXPECT() *MockOption_Expecter

func (*MockOption) Execute added in v1.3.0

func (_m *MockOption) Execute(_a0 *optionCtx)

Execute provides a mock function with given fields: _a0

type MockOption_Execute_Call added in v1.3.0

type MockOption_Execute_Call struct {
	*mock.Call
}

MockOption_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'

func (*MockOption_Execute_Call) Return added in v1.3.0

func (*MockOption_Execute_Call) Run added in v1.3.0

func (_c *MockOption_Execute_Call) Run(run func(_a0 *optionCtx)) *MockOption_Execute_Call

func (*MockOption_Execute_Call) RunAndReturn added in v1.3.0

func (_c *MockOption_Execute_Call) RunAndReturn(run func(*optionCtx)) *MockOption_Execute_Call

type MockOption_Expecter added in v1.3.0

type MockOption_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockOption_Expecter) Execute added in v1.3.0

func (_e *MockOption_Expecter) Execute(_a0 interface{}) *MockOption_Execute_Call

Execute is a helper method to define mock.On call

  • _a0 *optionCtx

type MockShouldLog added in v1.3.0

type MockShouldLog struct {
	mock.Mock
}

MockShouldLog is an autogenerated mock type for the ShouldLog type

func NewMockShouldLog added in v1.3.0

func NewMockShouldLog(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockShouldLog

NewMockShouldLog creates a new instance of MockShouldLog. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockShouldLog) EXPECT added in v1.3.0

func (_m *MockShouldLog) EXPECT() *MockShouldLog_Expecter

func (*MockShouldLog) Execute added in v1.3.0

func (_m *MockShouldLog) Execute(err error) bool

Execute provides a mock function with given fields: err

type MockShouldLog_Execute_Call added in v1.3.0

type MockShouldLog_Execute_Call struct {
	*mock.Call
}

MockShouldLog_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'

func (*MockShouldLog_Execute_Call) Return added in v1.3.0

func (*MockShouldLog_Execute_Call) Run added in v1.3.0

func (*MockShouldLog_Execute_Call) RunAndReturn added in v1.3.0

func (_c *MockShouldLog_Execute_Call) RunAndReturn(run func(error) bool) *MockShouldLog_Execute_Call

type MockShouldLog_Expecter added in v1.3.0

type MockShouldLog_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockShouldLog_Expecter) Execute added in v1.3.0

func (_e *MockShouldLog_Expecter) Execute(err interface{}) *MockShouldLog_Execute_Call

Execute is a helper method to define mock.On call

  • err error

type MockTracer added in v1.3.0

type MockTracer struct {
	mock.Mock
}

MockTracer is an autogenerated mock type for the Tracer type

func NewMockTracer added in v1.3.0

func NewMockTracer(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockTracer

NewMockTracer creates a new instance of MockTracer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockTracer) EXPECT added in v1.3.0

func (_m *MockTracer) EXPECT() *MockTracer_Expecter

func (*MockTracer) TraceBatchEnd added in v1.3.0

func (_m *MockTracer) TraceBatchEnd(ctx context.Context, conn *pgx.Conn, data pgx.TraceBatchEndData)

TraceBatchEnd provides a mock function with given fields: ctx, conn, data

func (*MockTracer) TraceBatchQuery added in v1.3.0

func (_m *MockTracer) TraceBatchQuery(ctx context.Context, conn *pgx.Conn, data pgx.TraceBatchQueryData)

TraceBatchQuery provides a mock function with given fields: ctx, conn, data

func (*MockTracer) TraceBatchStart added in v1.3.0

func (_m *MockTracer) TraceBatchStart(ctx context.Context, conn *pgx.Conn, data pgx.TraceBatchStartData) context.Context

TraceBatchStart provides a mock function with given fields: ctx, conn, data

func (*MockTracer) TraceConnectEnd added in v1.3.0

func (_m *MockTracer) TraceConnectEnd(ctx context.Context, data pgx.TraceConnectEndData)

TraceConnectEnd provides a mock function with given fields: ctx, data

func (*MockTracer) TraceConnectStart added in v1.3.0

func (_m *MockTracer) TraceConnectStart(ctx context.Context, data pgx.TraceConnectStartData) context.Context

TraceConnectStart provides a mock function with given fields: ctx, data

func (*MockTracer) TraceCopyFromEnd added in v1.3.0

func (_m *MockTracer) TraceCopyFromEnd(ctx context.Context, conn *pgx.Conn, data pgx.TraceCopyFromEndData)

TraceCopyFromEnd provides a mock function with given fields: ctx, conn, data

func (*MockTracer) TraceCopyFromStart added in v1.3.0

func (_m *MockTracer) TraceCopyFromStart(ctx context.Context, conn *pgx.Conn, data pgx.TraceCopyFromStartData) context.Context

TraceCopyFromStart provides a mock function with given fields: ctx, conn, data

func (*MockTracer) TracePrepareEnd added in v1.3.0

func (_m *MockTracer) TracePrepareEnd(ctx context.Context, conn *pgx.Conn, data pgx.TracePrepareEndData)

TracePrepareEnd provides a mock function with given fields: ctx, conn, data

func (*MockTracer) TracePrepareStart added in v1.3.0

func (_m *MockTracer) TracePrepareStart(ctx context.Context, conn *pgx.Conn, data pgx.TracePrepareStartData) context.Context

TracePrepareStart provides a mock function with given fields: ctx, conn, data

func (*MockTracer) TraceQueryEnd added in v1.3.0

func (_m *MockTracer) TraceQueryEnd(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryEndData)

TraceQueryEnd provides a mock function with given fields: ctx, conn, data

func (*MockTracer) TraceQueryStart added in v1.3.0

func (_m *MockTracer) TraceQueryStart(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryStartData) context.Context

TraceQueryStart provides a mock function with given fields: ctx, conn, data

type MockTracer_Expecter added in v1.3.0

type MockTracer_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockTracer_Expecter) TraceBatchEnd added in v1.3.0

func (_e *MockTracer_Expecter) TraceBatchEnd(ctx interface{}, conn interface{}, data interface{}) *MockTracer_TraceBatchEnd_Call

TraceBatchEnd is a helper method to define mock.On call

  • ctx context.Context
  • conn *pgx.Conn
  • data pgx.TraceBatchEndData

func (*MockTracer_Expecter) TraceBatchQuery added in v1.3.0

func (_e *MockTracer_Expecter) TraceBatchQuery(ctx interface{}, conn interface{}, data interface{}) *MockTracer_TraceBatchQuery_Call

TraceBatchQuery is a helper method to define mock.On call

  • ctx context.Context
  • conn *pgx.Conn
  • data pgx.TraceBatchQueryData

func (*MockTracer_Expecter) TraceBatchStart added in v1.3.0

func (_e *MockTracer_Expecter) TraceBatchStart(ctx interface{}, conn interface{}, data interface{}) *MockTracer_TraceBatchStart_Call

TraceBatchStart is a helper method to define mock.On call

  • ctx context.Context
  • conn *pgx.Conn
  • data pgx.TraceBatchStartData

func (*MockTracer_Expecter) TraceConnectEnd added in v1.3.0

func (_e *MockTracer_Expecter) TraceConnectEnd(ctx interface{}, data interface{}) *MockTracer_TraceConnectEnd_Call

TraceConnectEnd is a helper method to define mock.On call

  • ctx context.Context
  • data pgx.TraceConnectEndData

func (*MockTracer_Expecter) TraceConnectStart added in v1.3.0

func (_e *MockTracer_Expecter) TraceConnectStart(ctx interface{}, data interface{}) *MockTracer_TraceConnectStart_Call

TraceConnectStart is a helper method to define mock.On call

  • ctx context.Context
  • data pgx.TraceConnectStartData

func (*MockTracer_Expecter) TraceCopyFromEnd added in v1.3.0

func (_e *MockTracer_Expecter) TraceCopyFromEnd(ctx interface{}, conn interface{}, data interface{}) *MockTracer_TraceCopyFromEnd_Call

TraceCopyFromEnd is a helper method to define mock.On call

  • ctx context.Context
  • conn *pgx.Conn
  • data pgx.TraceCopyFromEndData

func (*MockTracer_Expecter) TraceCopyFromStart added in v1.3.0

func (_e *MockTracer_Expecter) TraceCopyFromStart(ctx interface{}, conn interface{}, data interface{}) *MockTracer_TraceCopyFromStart_Call

TraceCopyFromStart is a helper method to define mock.On call

  • ctx context.Context
  • conn *pgx.Conn
  • data pgx.TraceCopyFromStartData

func (*MockTracer_Expecter) TracePrepareEnd added in v1.3.0

func (_e *MockTracer_Expecter) TracePrepareEnd(ctx interface{}, conn interface{}, data interface{}) *MockTracer_TracePrepareEnd_Call

TracePrepareEnd is a helper method to define mock.On call

  • ctx context.Context
  • conn *pgx.Conn
  • data pgx.TracePrepareEndData

func (*MockTracer_Expecter) TracePrepareStart added in v1.3.0

func (_e *MockTracer_Expecter) TracePrepareStart(ctx interface{}, conn interface{}, data interface{}) *MockTracer_TracePrepareStart_Call

TracePrepareStart is a helper method to define mock.On call

  • ctx context.Context
  • conn *pgx.Conn
  • data pgx.TracePrepareStartData

func (*MockTracer_Expecter) TraceQueryEnd added in v1.3.0

func (_e *MockTracer_Expecter) TraceQueryEnd(ctx interface{}, conn interface{}, data interface{}) *MockTracer_TraceQueryEnd_Call

TraceQueryEnd is a helper method to define mock.On call

  • ctx context.Context
  • conn *pgx.Conn
  • data pgx.TraceQueryEndData

func (*MockTracer_Expecter) TraceQueryStart added in v1.3.0

func (_e *MockTracer_Expecter) TraceQueryStart(ctx interface{}, conn interface{}, data interface{}) *MockTracer_TraceQueryStart_Call

TraceQueryStart is a helper method to define mock.On call

  • ctx context.Context
  • conn *pgx.Conn
  • data pgx.TraceQueryStartData

type MockTracer_TraceBatchEnd_Call added in v1.3.0

type MockTracer_TraceBatchEnd_Call struct {
	*mock.Call
}

MockTracer_TraceBatchEnd_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TraceBatchEnd'

func (*MockTracer_TraceBatchEnd_Call) Return added in v1.3.0

func (*MockTracer_TraceBatchEnd_Call) Run added in v1.3.0

func (*MockTracer_TraceBatchEnd_Call) RunAndReturn added in v1.3.0

type MockTracer_TraceBatchQuery_Call added in v1.3.0

type MockTracer_TraceBatchQuery_Call struct {
	*mock.Call
}

MockTracer_TraceBatchQuery_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TraceBatchQuery'

func (*MockTracer_TraceBatchQuery_Call) Return added in v1.3.0

func (*MockTracer_TraceBatchQuery_Call) Run added in v1.3.0

func (*MockTracer_TraceBatchQuery_Call) RunAndReturn added in v1.3.0

type MockTracer_TraceBatchStart_Call added in v1.3.0

type MockTracer_TraceBatchStart_Call struct {
	*mock.Call
}

MockTracer_TraceBatchStart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TraceBatchStart'

func (*MockTracer_TraceBatchStart_Call) Return added in v1.3.0

func (*MockTracer_TraceBatchStart_Call) Run added in v1.3.0

func (*MockTracer_TraceBatchStart_Call) RunAndReturn added in v1.3.0

type MockTracer_TraceConnectEnd_Call added in v1.3.0

type MockTracer_TraceConnectEnd_Call struct {
	*mock.Call
}

MockTracer_TraceConnectEnd_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TraceConnectEnd'

func (*MockTracer_TraceConnectEnd_Call) Return added in v1.3.0

func (*MockTracer_TraceConnectEnd_Call) Run added in v1.3.0

func (*MockTracer_TraceConnectEnd_Call) RunAndReturn added in v1.3.0

type MockTracer_TraceConnectStart_Call added in v1.3.0

type MockTracer_TraceConnectStart_Call struct {
	*mock.Call
}

MockTracer_TraceConnectStart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TraceConnectStart'

func (*MockTracer_TraceConnectStart_Call) Return added in v1.3.0

func (*MockTracer_TraceConnectStart_Call) Run added in v1.3.0

func (*MockTracer_TraceConnectStart_Call) RunAndReturn added in v1.3.0

type MockTracer_TraceCopyFromEnd_Call added in v1.3.0

type MockTracer_TraceCopyFromEnd_Call struct {
	*mock.Call
}

MockTracer_TraceCopyFromEnd_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TraceCopyFromEnd'

func (*MockTracer_TraceCopyFromEnd_Call) Return added in v1.3.0

func (*MockTracer_TraceCopyFromEnd_Call) Run added in v1.3.0

func (*MockTracer_TraceCopyFromEnd_Call) RunAndReturn added in v1.3.0

type MockTracer_TraceCopyFromStart_Call added in v1.3.0

type MockTracer_TraceCopyFromStart_Call struct {
	*mock.Call
}

MockTracer_TraceCopyFromStart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TraceCopyFromStart'

func (*MockTracer_TraceCopyFromStart_Call) Return added in v1.3.0

func (*MockTracer_TraceCopyFromStart_Call) Run added in v1.3.0

func (*MockTracer_TraceCopyFromStart_Call) RunAndReturn added in v1.3.0

type MockTracer_TracePrepareEnd_Call added in v1.3.0

type MockTracer_TracePrepareEnd_Call struct {
	*mock.Call
}

MockTracer_TracePrepareEnd_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TracePrepareEnd'

func (*MockTracer_TracePrepareEnd_Call) Return added in v1.3.0

func (*MockTracer_TracePrepareEnd_Call) Run added in v1.3.0

func (*MockTracer_TracePrepareEnd_Call) RunAndReturn added in v1.3.0

type MockTracer_TracePrepareStart_Call added in v1.3.0

type MockTracer_TracePrepareStart_Call struct {
	*mock.Call
}

MockTracer_TracePrepareStart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TracePrepareStart'

func (*MockTracer_TracePrepareStart_Call) Return added in v1.3.0

func (*MockTracer_TracePrepareStart_Call) Run added in v1.3.0

func (*MockTracer_TracePrepareStart_Call) RunAndReturn added in v1.3.0

type MockTracer_TraceQueryEnd_Call added in v1.3.0

type MockTracer_TraceQueryEnd_Call struct {
	*mock.Call
}

MockTracer_TraceQueryEnd_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TraceQueryEnd'

func (*MockTracer_TraceQueryEnd_Call) Return added in v1.3.0

func (*MockTracer_TraceQueryEnd_Call) Run added in v1.3.0

func (*MockTracer_TraceQueryEnd_Call) RunAndReturn added in v1.3.0

type MockTracer_TraceQueryStart_Call added in v1.3.0

type MockTracer_TraceQueryStart_Call struct {
	*mock.Call
}

MockTracer_TraceQueryStart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TraceQueryStart'

func (*MockTracer_TraceQueryStart_Call) Return added in v1.3.0

func (*MockTracer_TraceQueryStart_Call) Run added in v1.3.0

func (*MockTracer_TraceQueryStart_Call) RunAndReturn added in v1.3.0

type Option added in v1.1.1

type Option func(*optionCtx)

func WithLatencyHistogramConfig added in v1.3.0

func WithLatencyHistogramConfig(name, unit, description string) Option

func WithLogArgs added in v1.3.0

func WithLogArgs(enabled bool) Option

func WithLogArgsLenLimit added in v1.3.0

func WithLogArgsLenLimit(limit int) Option

func WithLogger added in v1.3.0

func WithLogger(logger *slog.Logger) Option

func WithMeterProvider added in v1.3.0

func WithMeterProvider(mp metric.MeterProvider) Option

func WithShouldLog added in v1.3.0

func WithShouldLog(shouldLog ShouldLog) Option

func WithTraceProvider added in v1.3.0

func WithTraceProvider(tp trace.TracerProvider) Option

type ShouldLog added in v1.3.0

type ShouldLog func(err error) bool

type Tracer added in v1.3.0

type Tracer interface {
	pgx.BatchTracer
	pgx.ConnectTracer
	pgx.CopyFromTracer
	pgx.QueryTracer
	pgx.PrepareTracer
}

func NewDBTracer

func NewDBTracer(
	databaseName string,
	opts ...Option,
) (Tracer, error)

Jump to

Keyboard shortcuts

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