sqlconnect

package
v0.4.77 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 18 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientCertConfig added in v0.4.23

type ClientCertConfig struct {
	RootCert *string

	ClientCert *string
	ClientKey  *string
}

type ConnectionDetails

type ConnectionDetails struct {
	dbconnectconfig.GeneralDbConnectConfig
	MaxConnectionLimit *int32
}

func (*ConnectionDetails) String added in v0.4.26

func (c *ConnectionDetails) String() string

type DbConnectionOptions added in v0.4.77

type DbConnectionOptions struct {
	MaxOpenConns *int
	MaxIdleConns *int

	ConnMaxIdleTime *time.Duration
	ConnMaxLifetime *time.Duration
}

type MockSqlConnector

type MockSqlConnector struct {
	mock.Mock
}

MockSqlConnector is an autogenerated mock type for the SqlConnector type

func NewMockSqlConnector

func NewMockSqlConnector(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockSqlConnector

NewMockSqlConnector creates a new instance of MockSqlConnector. 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 (*MockSqlConnector) EXPECT

func (*MockSqlConnector) NewDbFromConnectionConfig

func (_m *MockSqlConnector) NewDbFromConnectionConfig(connectionConfig *mgmtv1alpha1.ConnectionConfig, connectionTimeout *uint32, logger *slog.Logger) (SqlDbContainer, error)

NewDbFromConnectionConfig provides a mock function with given fields: connectionConfig, connectionTimeout, logger

type MockSqlConnector_Expecter

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

func (*MockSqlConnector_Expecter) NewDbFromConnectionConfig

func (_e *MockSqlConnector_Expecter) NewDbFromConnectionConfig(connectionConfig interface{}, connectionTimeout interface{}, logger interface{}) *MockSqlConnector_NewDbFromConnectionConfig_Call

NewDbFromConnectionConfig is a helper method to define mock.On call

  • connectionConfig *mgmtv1alpha1.ConnectionConfig
  • connectionTimeout *uint32
  • logger *slog.Logger

type MockSqlConnector_NewDbFromConnectionConfig_Call

type MockSqlConnector_NewDbFromConnectionConfig_Call struct {
	*mock.Call
}

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

func (*MockSqlConnector_NewDbFromConnectionConfig_Call) Return

func (*MockSqlConnector_NewDbFromConnectionConfig_Call) Run

type MockSqlDbContainer

type MockSqlDbContainer struct {
	mock.Mock
}

MockSqlDbContainer is an autogenerated mock type for the SqlDbContainer type

func NewMockSqlDbContainer

func NewMockSqlDbContainer(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockSqlDbContainer

NewMockSqlDbContainer creates a new instance of MockSqlDbContainer. 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 (*MockSqlDbContainer) Close

func (_m *MockSqlDbContainer) Close() error

Close provides a mock function with given fields:

func (*MockSqlDbContainer) EXPECT

func (*MockSqlDbContainer) Open

func (_m *MockSqlDbContainer) Open() (SqlDBTX, error)

Open provides a mock function with given fields:

type MockSqlDbContainer_Close_Call

type MockSqlDbContainer_Close_Call struct {
	*mock.Call
}

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

func (*MockSqlDbContainer_Close_Call) Return

func (*MockSqlDbContainer_Close_Call) Run

func (*MockSqlDbContainer_Close_Call) RunAndReturn

type MockSqlDbContainer_Expecter

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

func (*MockSqlDbContainer_Expecter) Close

Close is a helper method to define mock.On call

func (*MockSqlDbContainer_Expecter) Open

Open is a helper method to define mock.On call

type MockSqlDbContainer_Open_Call

type MockSqlDbContainer_Open_Call struct {
	*mock.Call
}

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

func (*MockSqlDbContainer_Open_Call) Return

func (*MockSqlDbContainer_Open_Call) Run

func (*MockSqlDbContainer_Open_Call) RunAndReturn

type SqlConnector

type SqlConnector interface {
	NewDbFromConnectionConfig(connectionConfig *mgmtv1alpha1.ConnectionConfig, connectionTimeout *uint32, logger *slog.Logger) (SqlDbContainer, error)
}

type SqlDBTX

type SqlDBTX interface {
	mysql_queries.DBTX

	PingContext(context.Context) error
	BeginTx(context.Context, *sql.TxOptions) (*sql.Tx, error)
}

type SqlDbContainer

type SqlDbContainer interface {
	Open() (SqlDBTX, error)
	Close() error
}

interface used by SqlConnector to abstract away the opening and closing of a sqldb that includes tunnelingff

type SqlOpenConnector

type SqlOpenConnector struct{}

func (*SqlOpenConnector) NewDbFromConnectionConfig

func (rc *SqlOpenConnector) NewDbFromConnectionConfig(cc *mgmtv1alpha1.ConnectionConfig, connectionTimeout *uint32, logger *slog.Logger) (SqlDbContainer, error)

Jump to

Keyboard shortcuts

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