postgres

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultShutdownTimeout = 10 * time.Second
	DefaultShutdownHandler = true
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager added in v0.4.0

type Manager interface {
	Client() *gorm.DB
	SetClient(client *gorm.DB) Manager
	SetTelemetryManager(telemetry telemetry.Manager) error
	Migrate(migrations []*gormigrate.Migration, options *gormigrate.Options) error
	GetShutdownTimeout() time.Duration
	GetShutdownHandler() bool
	Shutdown(ctx context.Context, code int) error
}

func New

func New(opts ...Option) (Manager, error)

type MockManager added in v0.11.0

type MockManager struct {
	mock.Mock
}

MockManager is an autogenerated mock type for the Manager type

func NewMockManager added in v0.11.0

func NewMockManager(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockManager

NewMockManager creates a new instance of MockManager. 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 (*MockManager) Client added in v0.11.0

func (_mock *MockManager) Client() *gorm.DB

Client provides a mock function for the type MockManager

func (*MockManager) EXPECT added in v0.11.0

func (_m *MockManager) EXPECT() *MockManager_Expecter

func (*MockManager) GetShutdownHandler added in v0.11.0

func (_mock *MockManager) GetShutdownHandler() bool

GetShutdownHandler provides a mock function for the type MockManager

func (*MockManager) GetShutdownTimeout added in v0.11.0

func (_mock *MockManager) GetShutdownTimeout() time.Duration

GetShutdownTimeout provides a mock function for the type MockManager

func (*MockManager) Migrate added in v0.11.0

func (_mock *MockManager) Migrate(migrations []*gormigrate.Migration, options *gormigrate.Options) error

Migrate provides a mock function for the type MockManager

func (*MockManager) SetClient added in v0.11.0

func (_mock *MockManager) SetClient(client *gorm.DB) Manager

SetClient provides a mock function for the type MockManager

func (*MockManager) SetTelemetryManager added in v0.11.0

func (_mock *MockManager) SetTelemetryManager(telemetry1 telemetry.Manager) error

SetTelemetryManager provides a mock function for the type MockManager

func (*MockManager) Shutdown added in v0.11.0

func (_mock *MockManager) Shutdown(ctx context.Context, code int) error

Shutdown provides a mock function for the type MockManager

type MockManager_Client_Call added in v0.11.0

type MockManager_Client_Call struct {
	*mock.Call
}

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

func (*MockManager_Client_Call) Return added in v0.11.0

func (*MockManager_Client_Call) Run added in v0.11.0

func (_c *MockManager_Client_Call) Run(run func()) *MockManager_Client_Call

func (*MockManager_Client_Call) RunAndReturn added in v0.11.0

func (_c *MockManager_Client_Call) RunAndReturn(run func() *gorm.DB) *MockManager_Client_Call

type MockManager_Expecter added in v0.11.0

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

func (*MockManager_Expecter) Client added in v0.11.0

Client is a helper method to define mock.On call

func (*MockManager_Expecter) GetShutdownHandler added in v0.11.0

GetShutdownHandler is a helper method to define mock.On call

func (*MockManager_Expecter) GetShutdownTimeout added in v0.11.0

GetShutdownTimeout is a helper method to define mock.On call

func (*MockManager_Expecter) Migrate added in v0.11.0

func (_e *MockManager_Expecter) Migrate(migrations interface{}, options interface{}) *MockManager_Migrate_Call

Migrate is a helper method to define mock.On call

  • migrations []*gormigrate.Migration
  • options *gormigrate.Options

func (*MockManager_Expecter) SetClient added in v0.11.0

func (_e *MockManager_Expecter) SetClient(client interface{}) *MockManager_SetClient_Call

SetClient is a helper method to define mock.On call

  • client *gorm.DB

func (*MockManager_Expecter) SetTelemetryManager added in v0.11.0

func (_e *MockManager_Expecter) SetTelemetryManager(telemetry1 interface{}) *MockManager_SetTelemetryManager_Call

SetTelemetryManager is a helper method to define mock.On call

  • telemetry1 telemetry.Manager

func (*MockManager_Expecter) Shutdown added in v0.11.0

func (_e *MockManager_Expecter) Shutdown(ctx interface{}, code interface{}) *MockManager_Shutdown_Call

Shutdown is a helper method to define mock.On call

  • ctx context.Context
  • code int

type MockManager_GetShutdownHandler_Call added in v0.11.0

type MockManager_GetShutdownHandler_Call struct {
	*mock.Call
}

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

func (*MockManager_GetShutdownHandler_Call) Return added in v0.11.0

func (*MockManager_GetShutdownHandler_Call) Run added in v0.11.0

func (*MockManager_GetShutdownHandler_Call) RunAndReturn added in v0.11.0

type MockManager_GetShutdownTimeout_Call added in v0.11.0

type MockManager_GetShutdownTimeout_Call struct {
	*mock.Call
}

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

func (*MockManager_GetShutdownTimeout_Call) Return added in v0.11.0

func (*MockManager_GetShutdownTimeout_Call) Run added in v0.11.0

func (*MockManager_GetShutdownTimeout_Call) RunAndReturn added in v0.11.0

type MockManager_Migrate_Call added in v0.11.0

type MockManager_Migrate_Call struct {
	*mock.Call
}

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

func (*MockManager_Migrate_Call) Return added in v0.11.0

func (*MockManager_Migrate_Call) Run added in v0.11.0

func (_c *MockManager_Migrate_Call) Run(run func(migrations []*gormigrate.Migration, options *gormigrate.Options)) *MockManager_Migrate_Call

func (*MockManager_Migrate_Call) RunAndReturn added in v0.11.0

func (_c *MockManager_Migrate_Call) RunAndReturn(run func(migrations []*gormigrate.Migration, options *gormigrate.Options) error) *MockManager_Migrate_Call

type MockManager_SetClient_Call added in v0.11.0

type MockManager_SetClient_Call struct {
	*mock.Call
}

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

func (*MockManager_SetClient_Call) Return added in v0.11.0

func (*MockManager_SetClient_Call) Run added in v0.11.0

func (_c *MockManager_SetClient_Call) Run(run func(client *gorm.DB)) *MockManager_SetClient_Call

func (*MockManager_SetClient_Call) RunAndReturn added in v0.11.0

func (_c *MockManager_SetClient_Call) RunAndReturn(run func(client *gorm.DB) Manager) *MockManager_SetClient_Call

type MockManager_SetTelemetryManager_Call added in v0.11.0

type MockManager_SetTelemetryManager_Call struct {
	*mock.Call
}

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

func (*MockManager_SetTelemetryManager_Call) Return added in v0.11.0

func (*MockManager_SetTelemetryManager_Call) Run added in v0.11.0

func (*MockManager_SetTelemetryManager_Call) RunAndReturn added in v0.11.0

type MockManager_Shutdown_Call added in v0.11.0

type MockManager_Shutdown_Call struct {
	*mock.Call
}

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

func (*MockManager_Shutdown_Call) Return added in v0.11.0

func (*MockManager_Shutdown_Call) Run added in v0.11.0

func (*MockManager_Shutdown_Call) RunAndReturn added in v0.11.0

func (_c *MockManager_Shutdown_Call) RunAndReturn(run func(ctx context.Context, code int) error) *MockManager_Shutdown_Call

type Option

type Option func(*p) error

func WithClient

func WithClient(client *gorm.DB) Option

func WithClientOptions

func WithClientOptions(opts ...client.Option) Option

func WithShutdownTimeout

func WithShutdownTimeout(timeout time.Duration) Option

func WithoutShutdownHandler

func WithoutShutdownHandler() Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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