connectiontunnelmanager

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: 9 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 interface {
	String() string
	GetTunnel() *sshtunnel.Sshtunnel
}

type ConnectionProvider

type ConnectionProvider[T any, TConfig any] interface {
	GetConnectionDetails(connectionConfig *mgmtv1alpha1.ConnectionConfig, connectionTimeout *uint32, logger *slog.Logger) (ConnectionDetails, error)
	GetConnectionClient(driver string, connectionString string, opts TConfig) (T, error)
	GetConnectionClientConfig(connectionConfig *mgmtv1alpha1.ConnectionConfig) (TConfig, error)
	CloseClientConnection(client T) error
}

type ConnectionTunnelManager

type ConnectionTunnelManager[T any, TConfig any] struct {
	// contains filtered or unexported fields
}

func NewConnectionTunnelManager

func NewConnectionTunnelManager[T any, TConfig any](connectionProvider ConnectionProvider[T, TConfig]) *ConnectionTunnelManager[T, TConfig]

func (*ConnectionTunnelManager[T, TConfig]) GetConnection

func (c *ConnectionTunnelManager[T, TConfig]) GetConnection(
	session string,
	connection *mgmtv1alpha1.Connection,
	logger *slog.Logger,
) (T, error)

func (*ConnectionTunnelManager[T, TConfig]) GetConnectionString

func (c *ConnectionTunnelManager[T, TConfig]) GetConnectionString(
	session string,
	connection *mgmtv1alpha1.Connection,
	logger *slog.Logger,
) (string, error)

func (*ConnectionTunnelManager[T, TConfig]) Reaper

func (c *ConnectionTunnelManager[T, TConfig]) Reaper()

func (*ConnectionTunnelManager[T, TConfig]) ReleaseSession

func (c *ConnectionTunnelManager[T, TConfig]) ReleaseSession(session string) bool

func (*ConnectionTunnelManager[T, TConfig]) Shutdown

func (c *ConnectionTunnelManager[T, TConfig]) Shutdown()

type Interface

type Interface[T any] interface {
	GetConnectionString(session string, connection *mgmtv1alpha1.Connection, logger *slog.Logger) (string, error)
	GetConnection(session string, connection *mgmtv1alpha1.Connection, logger *slog.Logger) (T, error)

	ReleaseSession(session string) bool
	Shutdown()
	Reaper()
}

type MockConnectionProvider

type MockConnectionProvider[T interface{}, TConfig interface{}] struct {
	mock.Mock
}

MockConnectionProvider is an autogenerated mock type for the ConnectionProvider type

func NewMockConnectionProvider

func NewMockConnectionProvider[T interface{}, TConfig interface{}](t interface {
	mock.TestingT
	Cleanup(func())
}) *MockConnectionProvider[T, TConfig]

NewMockConnectionProvider creates a new instance of MockConnectionProvider. 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 (*MockConnectionProvider[T, TConfig]) CloseClientConnection

func (_m *MockConnectionProvider[T, TConfig]) CloseClientConnection(client T) error

CloseClientConnection provides a mock function with given fields: client

func (*MockConnectionProvider[T, TConfig]) EXPECT

func (_m *MockConnectionProvider[T, TConfig]) EXPECT() *MockConnectionProvider_Expecter[T, TConfig]

func (*MockConnectionProvider[T, TConfig]) GetConnectionClient

func (_m *MockConnectionProvider[T, TConfig]) GetConnectionClient(driver string, connectionString string, opts TConfig) (T, error)

GetConnectionClient provides a mock function with given fields: driver, connectionString, opts

func (*MockConnectionProvider[T, TConfig]) GetConnectionClientConfig

func (_m *MockConnectionProvider[T, TConfig]) GetConnectionClientConfig(connectionConfig *mgmtv1alpha1.ConnectionConfig) (TConfig, error)

GetConnectionClientConfig provides a mock function with given fields: connectionConfig

func (*MockConnectionProvider[T, TConfig]) GetConnectionDetails

func (_m *MockConnectionProvider[T, TConfig]) GetConnectionDetails(connectionConfig *mgmtv1alpha1.ConnectionConfig, connectionTimeout *uint32, logger *slog.Logger) (ConnectionDetails, error)

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

type MockConnectionProvider_CloseClientConnection_Call

type MockConnectionProvider_CloseClientConnection_Call[T interface{}, TConfig interface{}] struct {
	*mock.Call
}

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

func (*MockConnectionProvider_CloseClientConnection_Call[T, TConfig]) Return

func (*MockConnectionProvider_CloseClientConnection_Call[T, TConfig]) Run

func (*MockConnectionProvider_CloseClientConnection_Call[T, TConfig]) RunAndReturn

type MockConnectionProvider_Expecter

type MockConnectionProvider_Expecter[T interface{}, TConfig interface{}] struct {
	// contains filtered or unexported fields
}

func (*MockConnectionProvider_Expecter[T, TConfig]) CloseClientConnection

func (_e *MockConnectionProvider_Expecter[T, TConfig]) CloseClientConnection(client interface{}) *MockConnectionProvider_CloseClientConnection_Call[T, TConfig]

CloseClientConnection is a helper method to define mock.On call

  • client T

func (*MockConnectionProvider_Expecter[T, TConfig]) GetConnectionClient

func (_e *MockConnectionProvider_Expecter[T, TConfig]) GetConnectionClient(driver interface{}, connectionString interface{}, opts interface{}) *MockConnectionProvider_GetConnectionClient_Call[T, TConfig]

GetConnectionClient is a helper method to define mock.On call

  • driver string
  • connectionString string
  • opts TConfig

func (*MockConnectionProvider_Expecter[T, TConfig]) GetConnectionClientConfig

func (_e *MockConnectionProvider_Expecter[T, TConfig]) GetConnectionClientConfig(connectionConfig interface{}) *MockConnectionProvider_GetConnectionClientConfig_Call[T, TConfig]

GetConnectionClientConfig is a helper method to define mock.On call

  • connectionConfig *mgmtv1alpha1.ConnectionConfig

func (*MockConnectionProvider_Expecter[T, TConfig]) GetConnectionDetails

func (_e *MockConnectionProvider_Expecter[T, TConfig]) GetConnectionDetails(connectionConfig interface{}, connectionTimeout interface{}, logger interface{}) *MockConnectionProvider_GetConnectionDetails_Call[T, TConfig]

GetConnectionDetails is a helper method to define mock.On call

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

type MockConnectionProvider_GetConnectionClientConfig_Call

type MockConnectionProvider_GetConnectionClientConfig_Call[T interface{}, TConfig interface{}] struct {
	*mock.Call
}

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

func (*MockConnectionProvider_GetConnectionClientConfig_Call[T, TConfig]) Return

func (*MockConnectionProvider_GetConnectionClientConfig_Call[T, TConfig]) Run

func (*MockConnectionProvider_GetConnectionClientConfig_Call[T, TConfig]) RunAndReturn

type MockConnectionProvider_GetConnectionClient_Call

type MockConnectionProvider_GetConnectionClient_Call[T interface{}, TConfig interface{}] struct {
	*mock.Call
}

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

func (*MockConnectionProvider_GetConnectionClient_Call[T, TConfig]) Return

func (*MockConnectionProvider_GetConnectionClient_Call[T, TConfig]) Run

func (_c *MockConnectionProvider_GetConnectionClient_Call[T, TConfig]) Run(run func(driver string, connectionString string, opts TConfig)) *MockConnectionProvider_GetConnectionClient_Call[T, TConfig]

func (*MockConnectionProvider_GetConnectionClient_Call[T, TConfig]) RunAndReturn

func (_c *MockConnectionProvider_GetConnectionClient_Call[T, TConfig]) RunAndReturn(run func(string, string, TConfig) (T, error)) *MockConnectionProvider_GetConnectionClient_Call[T, TConfig]

type MockConnectionProvider_GetConnectionDetails_Call

type MockConnectionProvider_GetConnectionDetails_Call[T interface{}, TConfig interface{}] struct {
	*mock.Call
}

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

func (*MockConnectionProvider_GetConnectionDetails_Call[T, TConfig]) Return

func (*MockConnectionProvider_GetConnectionDetails_Call[T, TConfig]) Run

func (_c *MockConnectionProvider_GetConnectionDetails_Call[T, TConfig]) Run(run func(connectionConfig *mgmtv1alpha1.ConnectionConfig, connectionTimeout *uint32, logger *slog.Logger)) *MockConnectionProvider_GetConnectionDetails_Call[T, TConfig]

func (*MockConnectionProvider_GetConnectionDetails_Call[T, TConfig]) RunAndReturn

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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