Documentation ¶
Index ¶
- type ConnectionDetails
- type Connector
- type DbContainer
- type Interface
- type MockDbContainer
- type MockDbContainer_Close_Call
- type MockDbContainer_Expecter
- type MockDbContainer_Open_Call
- func (_c *MockDbContainer_Open_Call) Return(_a0 *mongo.Client, _a1 error) *MockDbContainer_Open_Call
- func (_c *MockDbContainer_Open_Call) Run(run func(ctx context.Context)) *MockDbContainer_Open_Call
- func (_c *MockDbContainer_Open_Call) RunAndReturn(run func(context.Context) (*mongo.Client, error)) *MockDbContainer_Open_Call
- type MockInterface
- type MockInterface_Expecter
- type MockInterface_NewFromConnectionConfig_Call
- func (_c *MockInterface_NewFromConnectionConfig_Call) Return(_a0 DbContainer, _a1 error) *MockInterface_NewFromConnectionConfig_Call
- func (_c *MockInterface_NewFromConnectionConfig_Call) Run(run func(cc *mgmtv1alpha1.ConnectionConfig, logger *slog.Logger)) *MockInterface_NewFromConnectionConfig_Call
- func (_c *MockInterface_NewFromConnectionConfig_Call) RunAndReturn(run func(*mgmtv1alpha1.ConnectionConfig, *slog.Logger) (DbContainer, error)) *MockInterface_NewFromConnectionConfig_Call
- type WrappedMongoClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionDetails ¶
type ConnectionDetails struct { Tunnel *sshtunnel.Sshtunnel Details *connstring.ConnString }
func GetConnectionDetails ¶
func GetConnectionDetails( cc *mgmtv1alpha1.ConnectionConfig, handleClientTlsConfig clienttls.ClientTlsFileHandler, logger *slog.Logger, ) (*ConnectionDetails, error)
func (*ConnectionDetails) GetTunnel ¶
func (c *ConnectionDetails) GetTunnel() *sshtunnel.Sshtunnel
func (*ConnectionDetails) String ¶
func (c *ConnectionDetails) String() string
type Connector ¶
type Connector struct{}
func NewConnector ¶
func NewConnector() *Connector
func (*Connector) NewFromConnectionConfig ¶
func (c *Connector) NewFromConnectionConfig( cc *mgmtv1alpha1.ConnectionConfig, logger *slog.Logger, ) (DbContainer, error)
type DbContainer ¶
type Interface ¶
type Interface interface {
NewFromConnectionConfig(cc *mgmtv1alpha1.ConnectionConfig, logger *slog.Logger) (DbContainer, error)
}
type MockDbContainer ¶
MockDbContainer is an autogenerated mock type for the DbContainer type
func NewMockDbContainer ¶
func NewMockDbContainer(t interface { mock.TestingT Cleanup(func()) }) *MockDbContainer
NewMockDbContainer creates a new instance of MockDbContainer. 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 (*MockDbContainer) Close ¶
func (_m *MockDbContainer) Close(_a0 context.Context) error
Close provides a mock function with given fields: _a0
func (*MockDbContainer) EXPECT ¶
func (_m *MockDbContainer) EXPECT() *MockDbContainer_Expecter
type MockDbContainer_Close_Call ¶
MockDbContainer_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
func (*MockDbContainer_Close_Call) Return ¶
func (_c *MockDbContainer_Close_Call) Return(_a0 error) *MockDbContainer_Close_Call
func (*MockDbContainer_Close_Call) Run ¶
func (_c *MockDbContainer_Close_Call) Run(run func(_a0 context.Context)) *MockDbContainer_Close_Call
func (*MockDbContainer_Close_Call) RunAndReturn ¶
func (_c *MockDbContainer_Close_Call) RunAndReturn(run func(context.Context) error) *MockDbContainer_Close_Call
type MockDbContainer_Expecter ¶
type MockDbContainer_Expecter struct {
// contains filtered or unexported fields
}
func (*MockDbContainer_Expecter) Close ¶
func (_e *MockDbContainer_Expecter) Close(_a0 interface{}) *MockDbContainer_Close_Call
Close is a helper method to define mock.On call
- _a0 context.Context
func (*MockDbContainer_Expecter) Open ¶
func (_e *MockDbContainer_Expecter) Open(ctx interface{}) *MockDbContainer_Open_Call
Open is a helper method to define mock.On call
- ctx context.Context
type MockDbContainer_Open_Call ¶
MockDbContainer_Open_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Open'
func (*MockDbContainer_Open_Call) Return ¶
func (_c *MockDbContainer_Open_Call) Return(_a0 *mongo.Client, _a1 error) *MockDbContainer_Open_Call
func (*MockDbContainer_Open_Call) Run ¶
func (_c *MockDbContainer_Open_Call) Run(run func(ctx context.Context)) *MockDbContainer_Open_Call
func (*MockDbContainer_Open_Call) RunAndReturn ¶
func (_c *MockDbContainer_Open_Call) RunAndReturn(run func(context.Context) (*mongo.Client, error)) *MockDbContainer_Open_Call
type MockInterface ¶
MockInterface is an autogenerated mock type for the Interface type
func NewMockInterface ¶
func NewMockInterface(t interface { mock.TestingT Cleanup(func()) }) *MockInterface
NewMockInterface creates a new instance of MockInterface. 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 (*MockInterface) EXPECT ¶
func (_m *MockInterface) EXPECT() *MockInterface_Expecter
func (*MockInterface) NewFromConnectionConfig ¶
func (_m *MockInterface) NewFromConnectionConfig(cc *mgmtv1alpha1.ConnectionConfig, logger *slog.Logger) (DbContainer, error)
NewFromConnectionConfig provides a mock function with given fields: cc, logger
type MockInterface_Expecter ¶
type MockInterface_Expecter struct {
// contains filtered or unexported fields
}
func (*MockInterface_Expecter) NewFromConnectionConfig ¶
func (_e *MockInterface_Expecter) NewFromConnectionConfig(cc interface{}, logger interface{}) *MockInterface_NewFromConnectionConfig_Call
NewFromConnectionConfig is a helper method to define mock.On call
- cc *mgmtv1alpha1.ConnectionConfig
- logger *slog.Logger
type MockInterface_NewFromConnectionConfig_Call ¶
MockInterface_NewFromConnectionConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewFromConnectionConfig'
func (*MockInterface_NewFromConnectionConfig_Call) Return ¶
func (_c *MockInterface_NewFromConnectionConfig_Call) Return(_a0 DbContainer, _a1 error) *MockInterface_NewFromConnectionConfig_Call
func (*MockInterface_NewFromConnectionConfig_Call) Run ¶
func (_c *MockInterface_NewFromConnectionConfig_Call) Run(run func(cc *mgmtv1alpha1.ConnectionConfig, logger *slog.Logger)) *MockInterface_NewFromConnectionConfig_Call
func (*MockInterface_NewFromConnectionConfig_Call) RunAndReturn ¶
func (_c *MockInterface_NewFromConnectionConfig_Call) RunAndReturn(run func(*mgmtv1alpha1.ConnectionConfig, *slog.Logger) (DbContainer, error)) *MockInterface_NewFromConnectionConfig_Call
type WrappedMongoClient ¶
type WrappedMongoClient struct {
// contains filtered or unexported fields
}