neosync_gcp

package
v0.4.47 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWorkflowActivityDataPrefix

func GetWorkflowActivityDataPrefix(runId, table string, prefixPath *string) string

func GetWorkflowActivityPrefix

func GetWorkflowActivityPrefix(runId string, prefixPath *string) string

Returns the prefix that contains the table folders in GCS

Types

type Client

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

func NewClient

func NewClient(client *storage.Client, logger *slog.Logger) *Client

func (*Client) DoesPrefixContainTables

func (c *Client) DoesPrefixContainTables(
	ctx context.Context,
	bucketName string,
	prefix string,
) (bool, error)

func (*Client) GetDbSchemaFromPrefix

func (c *Client) GetDbSchemaFromPrefix(
	ctx context.Context,
	bucketName string,
	prefix string,
) ([]*mgmtv1alpha1.DatabaseColumn, error)

func (*Client) GetRecordStreamFromPrefix

func (c *Client) GetRecordStreamFromPrefix(
	ctx context.Context,
	bucketName string,
	prefix string,
	onRecord func(record map[string][]byte) error,
) error

type ClientInterface

type ClientInterface interface {
	GetDbSchemaFromPrefix(ctx context.Context, bucketName string, prefix string) ([]*mgmtv1alpha1.DatabaseColumn, error)
	DoesPrefixContainTables(ctx context.Context, bucketName string, prefix string) (bool, error)
	GetRecordStreamFromPrefix(
		ctx context.Context,
		bucketName string,
		prefix string,
		onRecord func(record map[string][]byte) error,
	) error
}

type Manager

type Manager struct{}

func NewManager

func NewManager() *Manager

func (*Manager) GetClient

func (m *Manager) GetClient(ctx context.Context, logger *slog.Logger) (ClientInterface, error)

type ManagerInterface

type ManagerInterface interface {
	GetClient(ctx context.Context, logger *slog.Logger) (ClientInterface, error)
}

type MockClientInterface

type MockClientInterface struct {
	mock.Mock
}

MockClientInterface is an autogenerated mock type for the ClientInterface type

func NewMockClientInterface

func NewMockClientInterface(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockClientInterface

NewMockClientInterface creates a new instance of MockClientInterface. 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 (*MockClientInterface) DoesPrefixContainTables

func (_m *MockClientInterface) DoesPrefixContainTables(ctx context.Context, bucketName string, prefix string) (bool, error)

DoesPrefixContainTables provides a mock function with given fields: ctx, bucketName, prefix

func (*MockClientInterface) EXPECT

func (*MockClientInterface) GetDbSchemaFromPrefix

func (_m *MockClientInterface) GetDbSchemaFromPrefix(ctx context.Context, bucketName string, prefix string) ([]*mgmtv1alpha1.DatabaseColumn, error)

GetDbSchemaFromPrefix provides a mock function with given fields: ctx, bucketName, prefix

func (*MockClientInterface) GetRecordStreamFromPrefix

func (_m *MockClientInterface) GetRecordStreamFromPrefix(ctx context.Context, bucketName string, prefix string, onRecord func(map[string][]byte) error) error

GetRecordStreamFromPrefix provides a mock function with given fields: ctx, bucketName, prefix, onRecord

type MockClientInterface_DoesPrefixContainTables_Call

type MockClientInterface_DoesPrefixContainTables_Call struct {
	*mock.Call
}

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

func (*MockClientInterface_DoesPrefixContainTables_Call) Return

func (*MockClientInterface_DoesPrefixContainTables_Call) Run

func (*MockClientInterface_DoesPrefixContainTables_Call) RunAndReturn

type MockClientInterface_Expecter

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

func (*MockClientInterface_Expecter) DoesPrefixContainTables

func (_e *MockClientInterface_Expecter) DoesPrefixContainTables(ctx interface{}, bucketName interface{}, prefix interface{}) *MockClientInterface_DoesPrefixContainTables_Call

DoesPrefixContainTables is a helper method to define mock.On call

  • ctx context.Context
  • bucketName string
  • prefix string

func (*MockClientInterface_Expecter) GetDbSchemaFromPrefix

func (_e *MockClientInterface_Expecter) GetDbSchemaFromPrefix(ctx interface{}, bucketName interface{}, prefix interface{}) *MockClientInterface_GetDbSchemaFromPrefix_Call

GetDbSchemaFromPrefix is a helper method to define mock.On call

  • ctx context.Context
  • bucketName string
  • prefix string

func (*MockClientInterface_Expecter) GetRecordStreamFromPrefix

func (_e *MockClientInterface_Expecter) GetRecordStreamFromPrefix(ctx interface{}, bucketName interface{}, prefix interface{}, onRecord interface{}) *MockClientInterface_GetRecordStreamFromPrefix_Call

GetRecordStreamFromPrefix is a helper method to define mock.On call

  • ctx context.Context
  • bucketName string
  • prefix string
  • onRecord func(map[string][]byte) error

type MockClientInterface_GetDbSchemaFromPrefix_Call

type MockClientInterface_GetDbSchemaFromPrefix_Call struct {
	*mock.Call
}

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

func (*MockClientInterface_GetDbSchemaFromPrefix_Call) Return

func (*MockClientInterface_GetDbSchemaFromPrefix_Call) Run

func (*MockClientInterface_GetDbSchemaFromPrefix_Call) RunAndReturn

type MockClientInterface_GetRecordStreamFromPrefix_Call

type MockClientInterface_GetRecordStreamFromPrefix_Call struct {
	*mock.Call
}

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

func (*MockClientInterface_GetRecordStreamFromPrefix_Call) Return

func (*MockClientInterface_GetRecordStreamFromPrefix_Call) Run

func (*MockClientInterface_GetRecordStreamFromPrefix_Call) RunAndReturn

type MockManagerInterface

type MockManagerInterface struct {
	mock.Mock
}

MockManagerInterface is an autogenerated mock type for the ManagerInterface type

func NewMockManagerInterface

func NewMockManagerInterface(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockManagerInterface

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

func (*MockManagerInterface) GetClient

func (_m *MockManagerInterface) GetClient(ctx context.Context, logger *slog.Logger) (ClientInterface, error)

GetClient provides a mock function with given fields: ctx, logger

type MockManagerInterface_Expecter

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

func (*MockManagerInterface_Expecter) GetClient

func (_e *MockManagerInterface_Expecter) GetClient(ctx interface{}, logger interface{}) *MockManagerInterface_GetClient_Call

GetClient is a helper method to define mock.On call

  • ctx context.Context
  • logger *slog.Logger

type MockManagerInterface_GetClient_Call

type MockManagerInterface_GetClient_Call struct {
	*mock.Call
}

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

func (*MockManagerInterface_GetClient_Call) Return

func (*MockManagerInterface_GetClient_Call) Run

func (*MockManagerInterface_GetClient_Call) RunAndReturn

Jump to

Keyboard shortcuts

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