mongoconnect

package
v0.4.69 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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 DbContainer interface {
	Open(ctx context.Context) (*mongo.Client, error)
	Close(context.Context) error
}

type Interface

type Interface interface {
	NewFromConnectionConfig(cc *mgmtv1alpha1.ConnectionConfig, logger *slog.Logger) (DbContainer, error)
}

type MockDbContainer

type MockDbContainer struct {
	mock.Mock
}

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 (*MockDbContainer) Open

func (_m *MockDbContainer) Open(ctx context.Context) (*mongo.Client, error)

Open provides a mock function with given fields: ctx

type MockDbContainer_Close_Call

type MockDbContainer_Close_Call struct {
	*mock.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 (*MockDbContainer_Close_Call) Run

func (*MockDbContainer_Close_Call) RunAndReturn

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

type MockDbContainer_Open_Call struct {
	*mock.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 (*MockDbContainer_Open_Call) Run

func (*MockDbContainer_Open_Call) RunAndReturn

type MockInterface

type MockInterface struct {
	mock.Mock
}

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

type MockInterface_NewFromConnectionConfig_Call struct {
	*mock.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 (*MockInterface_NewFromConnectionConfig_Call) Run

func (*MockInterface_NewFromConnectionConfig_Call) RunAndReturn

type WrappedMongoClient

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

func (*WrappedMongoClient) Close

func (w *WrappedMongoClient) Close(ctx context.Context) error

func (*WrappedMongoClient) Open

Jump to

Keyboard shortcuts

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