Documentation ¶
Index ¶
- type ClientCertConfig
- type ConnectionDetails
- type GeneralDbConnectConfig
- type MockPgPoolContainer
- type MockPgPoolContainer_Close_Call
- type MockPgPoolContainer_Expecter
- type MockPgPoolContainer_Open_Call
- func (_c *MockPgPoolContainer_Open_Call) Return(_a0 pg_queries.DBTX, _a1 error) *MockPgPoolContainer_Open_Call
- func (_c *MockPgPoolContainer_Open_Call) Run(run func(_a0 context.Context)) *MockPgPoolContainer_Open_Call
- func (_c *MockPgPoolContainer_Open_Call) RunAndReturn(run func(context.Context) (pg_queries.DBTX, error)) *MockPgPoolContainer_Open_Call
- type MockSqlConnector
- func (_m *MockSqlConnector) EXPECT() *MockSqlConnector_Expecter
- func (_m *MockSqlConnector) NewDbFromConnectionConfig(connectionConfig *mgmtv1alpha1.ConnectionConfig, connectionTimeout *uint32, ...) (SqlDbContainer, error)
- func (_m *MockSqlConnector) NewPgPoolFromConnectionConfig(pgconfig *mgmtv1alpha1.PostgresConnectionConfig, connectionTimeout *uint32, ...) (PgPoolContainer, error)
- type MockSqlConnector_Expecter
- func (_e *MockSqlConnector_Expecter) NewDbFromConnectionConfig(connectionConfig interface{}, connectionTimeout interface{}, ...) *MockSqlConnector_NewDbFromConnectionConfig_Call
- func (_e *MockSqlConnector_Expecter) NewPgPoolFromConnectionConfig(pgconfig interface{}, connectionTimeout interface{}, logger interface{}) *MockSqlConnector_NewPgPoolFromConnectionConfig_Call
- type MockSqlConnector_NewDbFromConnectionConfig_Call
- func (_c *MockSqlConnector_NewDbFromConnectionConfig_Call) Return(_a0 SqlDbContainer, _a1 error) *MockSqlConnector_NewDbFromConnectionConfig_Call
- func (_c *MockSqlConnector_NewDbFromConnectionConfig_Call) Run(...) *MockSqlConnector_NewDbFromConnectionConfig_Call
- func (_c *MockSqlConnector_NewDbFromConnectionConfig_Call) RunAndReturn(...) *MockSqlConnector_NewDbFromConnectionConfig_Call
- type MockSqlConnector_NewPgPoolFromConnectionConfig_Call
- func (_c *MockSqlConnector_NewPgPoolFromConnectionConfig_Call) Return(_a0 PgPoolContainer, _a1 error) *MockSqlConnector_NewPgPoolFromConnectionConfig_Call
- func (_c *MockSqlConnector_NewPgPoolFromConnectionConfig_Call) Run(...) *MockSqlConnector_NewPgPoolFromConnectionConfig_Call
- func (_c *MockSqlConnector_NewPgPoolFromConnectionConfig_Call) RunAndReturn(...) *MockSqlConnector_NewPgPoolFromConnectionConfig_Call
- type MockSqlDbContainer
- type MockSqlDbContainer_Close_Call
- type MockSqlDbContainer_Expecter
- type MockSqlDbContainer_Open_Call
- type PgPool
- type PgPoolContainer
- type SqlConnector
- type SqlDBTX
- type SqlDb
- type SqlDbContainer
- type SqlOpenConnector
- func (rc *SqlOpenConnector) NewDbFromConnectionConfig(connectionConfig *mgmtv1alpha1.ConnectionConfig, connectionTimeout *uint32, ...) (SqlDbContainer, error)
- func (rc *SqlOpenConnector) NewPgPoolFromConnectionConfig(pgconfig *mgmtv1alpha1.PostgresConnectionConfig, connectionTimeout *uint32, ...) (PgPoolContainer, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientCertConfig ¶ added in v0.4.23
type ConnectionDetails ¶
type ConnectionDetails struct { GeneralDbConnectConfig MaxConnectionLimit *int32 Tunnel *sshtunnel.Sshtunnel }
func GetConnectionDetails ¶
func GetConnectionDetails( c *mgmtv1alpha1.ConnectionConfig, connectionTimeout *uint32, handleClientTlsConfig clienttls.ClientTlsFileHandler, logger *slog.Logger, ) (*ConnectionDetails, error)
Method for retrieving connection details, including tunneling information. Only use if requiring direct access to the SSH Tunnel, otherwise the SqlConnector should be used instead.
func (*ConnectionDetails) GetTunnel ¶ added in v0.4.26
func (c *ConnectionDetails) GetTunnel() *sshtunnel.Sshtunnel
func (*ConnectionDetails) String ¶ added in v0.4.26
func (c *ConnectionDetails) String() string
type GeneralDbConnectConfig ¶
type GeneralDbConnectConfig struct { Driver string Host string Port int32 Database string User string Pass string Protocol *string QueryParams url.Values }
func (*GeneralDbConnectConfig) String ¶
func (g *GeneralDbConnectConfig) String() string
type MockPgPoolContainer ¶
MockPgPoolContainer is an autogenerated mock type for the PgPoolContainer type
func NewMockPgPoolContainer ¶
func NewMockPgPoolContainer(t interface { mock.TestingT Cleanup(func()) }) *MockPgPoolContainer
NewMockPgPoolContainer creates a new instance of MockPgPoolContainer. 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 (*MockPgPoolContainer) Close ¶
func (_m *MockPgPoolContainer) Close()
Close provides a mock function with given fields:
func (*MockPgPoolContainer) EXPECT ¶
func (_m *MockPgPoolContainer) EXPECT() *MockPgPoolContainer_Expecter
func (*MockPgPoolContainer) Open ¶
func (_m *MockPgPoolContainer) Open(_a0 context.Context) (pg_queries.DBTX, error)
Open provides a mock function with given fields: _a0
type MockPgPoolContainer_Close_Call ¶
MockPgPoolContainer_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
func (*MockPgPoolContainer_Close_Call) Return ¶
func (_c *MockPgPoolContainer_Close_Call) Return() *MockPgPoolContainer_Close_Call
func (*MockPgPoolContainer_Close_Call) Run ¶
func (_c *MockPgPoolContainer_Close_Call) Run(run func()) *MockPgPoolContainer_Close_Call
func (*MockPgPoolContainer_Close_Call) RunAndReturn ¶
func (_c *MockPgPoolContainer_Close_Call) RunAndReturn(run func()) *MockPgPoolContainer_Close_Call
type MockPgPoolContainer_Expecter ¶
type MockPgPoolContainer_Expecter struct {
// contains filtered or unexported fields
}
func (*MockPgPoolContainer_Expecter) Close ¶
func (_e *MockPgPoolContainer_Expecter) Close() *MockPgPoolContainer_Close_Call
Close is a helper method to define mock.On call
func (*MockPgPoolContainer_Expecter) Open ¶
func (_e *MockPgPoolContainer_Expecter) Open(_a0 interface{}) *MockPgPoolContainer_Open_Call
Open is a helper method to define mock.On call
- _a0 context.Context
type MockPgPoolContainer_Open_Call ¶
MockPgPoolContainer_Open_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Open'
func (*MockPgPoolContainer_Open_Call) Return ¶
func (_c *MockPgPoolContainer_Open_Call) Return(_a0 pg_queries.DBTX, _a1 error) *MockPgPoolContainer_Open_Call
func (*MockPgPoolContainer_Open_Call) Run ¶
func (_c *MockPgPoolContainer_Open_Call) Run(run func(_a0 context.Context)) *MockPgPoolContainer_Open_Call
func (*MockPgPoolContainer_Open_Call) RunAndReturn ¶
func (_c *MockPgPoolContainer_Open_Call) RunAndReturn(run func(context.Context) (pg_queries.DBTX, error)) *MockPgPoolContainer_Open_Call
type MockSqlConnector ¶
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 (_m *MockSqlConnector) EXPECT() *MockSqlConnector_Expecter
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
func (*MockSqlConnector) NewPgPoolFromConnectionConfig ¶
func (_m *MockSqlConnector) NewPgPoolFromConnectionConfig(pgconfig *mgmtv1alpha1.PostgresConnectionConfig, connectionTimeout *uint32, logger *slog.Logger) (PgPoolContainer, error)
NewPgPoolFromConnectionConfig provides a mock function with given fields: pgconfig, 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
func (*MockSqlConnector_Expecter) NewPgPoolFromConnectionConfig ¶
func (_e *MockSqlConnector_Expecter) NewPgPoolFromConnectionConfig(pgconfig interface{}, connectionTimeout interface{}, logger interface{}) *MockSqlConnector_NewPgPoolFromConnectionConfig_Call
NewPgPoolFromConnectionConfig is a helper method to define mock.On call
- pgconfig *mgmtv1alpha1.PostgresConnectionConfig
- connectionTimeout *uint32
- logger *slog.Logger
type MockSqlConnector_NewDbFromConnectionConfig_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 (_c *MockSqlConnector_NewDbFromConnectionConfig_Call) Return(_a0 SqlDbContainer, _a1 error) *MockSqlConnector_NewDbFromConnectionConfig_Call
func (*MockSqlConnector_NewDbFromConnectionConfig_Call) Run ¶
func (_c *MockSqlConnector_NewDbFromConnectionConfig_Call) Run(run func(connectionConfig *mgmtv1alpha1.ConnectionConfig, connectionTimeout *uint32, logger *slog.Logger)) *MockSqlConnector_NewDbFromConnectionConfig_Call
func (*MockSqlConnector_NewDbFromConnectionConfig_Call) RunAndReturn ¶
func (_c *MockSqlConnector_NewDbFromConnectionConfig_Call) RunAndReturn(run func(*mgmtv1alpha1.ConnectionConfig, *uint32, *slog.Logger) (SqlDbContainer, error)) *MockSqlConnector_NewDbFromConnectionConfig_Call
type MockSqlConnector_NewPgPoolFromConnectionConfig_Call ¶
MockSqlConnector_NewPgPoolFromConnectionConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewPgPoolFromConnectionConfig'
func (*MockSqlConnector_NewPgPoolFromConnectionConfig_Call) Return ¶
func (_c *MockSqlConnector_NewPgPoolFromConnectionConfig_Call) Return(_a0 PgPoolContainer, _a1 error) *MockSqlConnector_NewPgPoolFromConnectionConfig_Call
func (*MockSqlConnector_NewPgPoolFromConnectionConfig_Call) Run ¶
func (_c *MockSqlConnector_NewPgPoolFromConnectionConfig_Call) Run(run func(pgconfig *mgmtv1alpha1.PostgresConnectionConfig, connectionTimeout *uint32, logger *slog.Logger)) *MockSqlConnector_NewPgPoolFromConnectionConfig_Call
func (*MockSqlConnector_NewPgPoolFromConnectionConfig_Call) RunAndReturn ¶
func (_c *MockSqlConnector_NewPgPoolFromConnectionConfig_Call) RunAndReturn(run func(*mgmtv1alpha1.PostgresConnectionConfig, *uint32, *slog.Logger) (PgPoolContainer, error)) *MockSqlConnector_NewPgPoolFromConnectionConfig_Call
type MockSqlDbContainer ¶
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 (_m *MockSqlDbContainer) EXPECT() *MockSqlDbContainer_Expecter
func (*MockSqlDbContainer) Open ¶
func (_m *MockSqlDbContainer) Open() (SqlDBTX, error)
Open provides a mock function with given fields:
type MockSqlDbContainer_Close_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 (_c *MockSqlDbContainer_Close_Call) Return(_a0 error) *MockSqlDbContainer_Close_Call
func (*MockSqlDbContainer_Close_Call) Run ¶
func (_c *MockSqlDbContainer_Close_Call) Run(run func()) *MockSqlDbContainer_Close_Call
func (*MockSqlDbContainer_Close_Call) RunAndReturn ¶
func (_c *MockSqlDbContainer_Close_Call) RunAndReturn(run func() error) *MockSqlDbContainer_Close_Call
type MockSqlDbContainer_Expecter ¶
type MockSqlDbContainer_Expecter struct {
// contains filtered or unexported fields
}
func (*MockSqlDbContainer_Expecter) Close ¶
func (_e *MockSqlDbContainer_Expecter) Close() *MockSqlDbContainer_Close_Call
Close is a helper method to define mock.On call
func (*MockSqlDbContainer_Expecter) Open ¶
func (_e *MockSqlDbContainer_Expecter) Open() *MockSqlDbContainer_Open_Call
Open is a helper method to define mock.On call
type MockSqlDbContainer_Open_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 (_c *MockSqlDbContainer_Open_Call) Return(_a0 SqlDBTX, _a1 error) *MockSqlDbContainer_Open_Call
func (*MockSqlDbContainer_Open_Call) Run ¶
func (_c *MockSqlDbContainer_Open_Call) Run(run func()) *MockSqlDbContainer_Open_Call
func (*MockSqlDbContainer_Open_Call) RunAndReturn ¶
func (_c *MockSqlDbContainer_Open_Call) RunAndReturn(run func() (SqlDBTX, error)) *MockSqlDbContainer_Open_Call
type PgPoolContainer ¶
type PgPoolContainer interface { Open(context.Context) (pg_queries.DBTX, error) Close() }
interface used by SqlConnector to abstract away the opening and closing of a Pgxpool that includes tunneling
type SqlConnector ¶
type SqlConnector interface { NewDbFromConnectionConfig(connectionConfig *mgmtv1alpha1.ConnectionConfig, connectionTimeout *uint32, logger *slog.Logger) (SqlDbContainer, error) NewPgPoolFromConnectionConfig(pgconfig *mgmtv1alpha1.PostgresConnectionConfig, connectionTimeout *uint32, logger *slog.Logger) (PgPoolContainer, error) }
Allows instantiating a sql db or pg pool container that includes SSH tunneling if the config requires it
type SqlDbContainer ¶
interface used by SqlConnector to abstract away the opening and closing of a sqldb that includes tunneling
type SqlOpenConnector ¶
type SqlOpenConnector struct{}
func (*SqlOpenConnector) NewDbFromConnectionConfig ¶
func (rc *SqlOpenConnector) NewDbFromConnectionConfig(connectionConfig *mgmtv1alpha1.ConnectionConfig, connectionTimeout *uint32, logger *slog.Logger) (SqlDbContainer, error)
func (*SqlOpenConnector) NewPgPoolFromConnectionConfig ¶
func (rc *SqlOpenConnector) NewPgPoolFromConnectionConfig(pgconfig *mgmtv1alpha1.PostgresConnectionConfig, connectionTimeout *uint32, logger *slog.Logger) (PgPoolContainer, error)