Documentation ¶
Index ¶
- func DoInterfaceSelect[T any](ctx context.Context, d *YdbConnector, queryBuilder queries.ReadTableQuery, ...) ([]T, error)
- func DoStructSelect[T any](ctx context.Context, d *YdbConnector, queryBuilder queries.ReadTableQuery, ...) ([]*T, error)
- func Int64OrZero(number *int64) int64
- func ReadBackupFromResultSet(res result.Result) (*types.Backup, error)
- func ReadBackupScheduleFromResultSet(res result.Result, withRPOInfo bool) (*types.BackupSchedule, error)
- func ReadOperationFromResultSet(res result.Result) (types.Operation, error)
- func StringOrDefault(str *string, def string) string
- func StringOrEmpty(str *string) string
- type DBConnector
- type InterfaceFromResultSet
- type MockDBConnector
- func (c *MockDBConnector) ActiveOperations(_ context.Context) ([]types.Operation, error)
- func (c *MockDBConnector) Close(_ context.Context)
- func (c *MockDBConnector) CreateBackup(_ context.Context, backup types.Backup) (string, error)
- func (c *MockDBConnector) CreateOperation(_ context.Context, op types.Operation) (string, error)
- func (c *MockDBConnector) ExecuteUpsert(_ context.Context, queryBuilder queries.WriteTableQuery) error
- func (c *MockDBConnector) GetBackup(_ context.Context, backupID string) (types.Backup, error)
- func (c *MockDBConnector) GetOperation(_ context.Context, operationID string) (types.Operation, error)
- func (c *MockDBConnector) GetSchedule(_ context.Context, scheduleID string) (types.BackupSchedule, error)
- func (c *MockDBConnector) GetTableClient() table.Client
- func (c *MockDBConnector) SelectBackupSchedules(_ context.Context, _ queries.ReadTableQuery) ([]*types.BackupSchedule, error)
- func (c *MockDBConnector) SelectBackupSchedulesWithRPOInfo(_ context.Context, _ queries.ReadTableQuery) ([]*types.BackupSchedule, error)
- func (c *MockDBConnector) SelectBackups(_ context.Context, _ queries.ReadTableQuery) ([]*types.Backup, error)
- func (c *MockDBConnector) SelectBackupsByStatus(_ context.Context, _ string) ([]*types.Backup, error)
- func (c *MockDBConnector) SelectOperations(_ context.Context, _ queries.ReadTableQuery) ([]types.Operation, error)
- func (c *MockDBConnector) UpdateBackup(_ context.Context, id string, backupStatus string) error
- func (c *MockDBConnector) UpdateOperation(_ context.Context, op types.Operation) error
- type Option
- type StructFromResultSet
- type YdbConnector
- func (d *YdbConnector) ActiveOperations(ctx context.Context) ([]types.Operation, error)
- func (d *YdbConnector) Close(ctx context.Context)
- func (d *YdbConnector) CreateBackup(ctx context.Context, backup types.Backup) (string, error)
- func (d *YdbConnector) CreateOperation(ctx context.Context, operation types.Operation) (string, error)
- func (d *YdbConnector) ExecuteUpsert(ctx context.Context, queryBuilder queries.WriteTableQuery) error
- func (d *YdbConnector) GetTableClient() table.Client
- func (d *YdbConnector) SelectBackupSchedules(ctx context.Context, queryBuilder queries.ReadTableQuery) ([]*types.BackupSchedule, error)
- func (d *YdbConnector) SelectBackupSchedulesWithRPOInfo(ctx context.Context, queryBuilder queries.ReadTableQuery) ([]*types.BackupSchedule, error)
- func (d *YdbConnector) SelectBackups(ctx context.Context, queryBuilder queries.ReadTableQuery) ([]*types.Backup, error)
- func (d *YdbConnector) SelectOperations(ctx context.Context, queryBuilder queries.ReadTableQuery) ([]types.Operation, error)
- func (d *YdbConnector) UpdateBackup(ctx context.Context, id string, backupStatus string) error
- func (d *YdbConnector) UpdateOperation(ctx context.Context, operation types.Operation) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoInterfaceSelect ¶
func DoInterfaceSelect[T any]( ctx context.Context, d *YdbConnector, queryBuilder queries.ReadTableQuery, readLambda InterfaceFromResultSet[T], ) ([]T, error)
func DoStructSelect ¶
func DoStructSelect[T any]( ctx context.Context, d *YdbConnector, queryBuilder queries.ReadTableQuery, readLambda StructFromResultSet[T], ) ([]*T, error)
func Int64OrZero ¶
func ReadBackupFromResultSet ¶
func StringOrDefault ¶
func StringOrEmpty ¶
Types ¶
type DBConnector ¶
type DBConnector interface { GetTableClient() table.Client SelectBackups(ctx context.Context, queryBuilder queries.ReadTableQuery) ( []*types.Backup, error, ) SelectOperations(ctx context.Context, queryBuilder queries.ReadTableQuery) ( []types.Operation, error, ) SelectBackupSchedules(ctx context.Context, queryBuilder queries.ReadTableQuery) ([]*types.BackupSchedule, error) SelectBackupSchedulesWithRPOInfo(ctx context.Context, queryBuilder queries.ReadTableQuery) ( []*types.BackupSchedule, error, ) ActiveOperations(context.Context) ([]types.Operation, error) UpdateOperation(context.Context, types.Operation) error CreateOperation(context.Context, types.Operation) (string, error) CreateBackup(context.Context, types.Backup) (string, error) UpdateBackup(context context.Context, id string, backupState string) error ExecuteUpsert(ctx context.Context, queryBuilder queries.WriteTableQuery) error Close(context.Context) }
type InterfaceFromResultSet ¶
type MockDBConnector ¶
type MockDBConnector struct {
// contains filtered or unexported fields
}
func NewMockDBConnector ¶
func NewMockDBConnector(options ...Option) *MockDBConnector
func (*MockDBConnector) ActiveOperations ¶
func (*MockDBConnector) Close ¶
func (c *MockDBConnector) Close(_ context.Context)
func (*MockDBConnector) CreateBackup ¶
func (*MockDBConnector) CreateOperation ¶
func (*MockDBConnector) ExecuteUpsert ¶
func (c *MockDBConnector) ExecuteUpsert(_ context.Context, queryBuilder queries.WriteTableQuery) error
func (*MockDBConnector) GetOperation ¶
func (*MockDBConnector) GetSchedule ¶
func (c *MockDBConnector) GetSchedule( _ context.Context, scheduleID string, ) (types.BackupSchedule, error)
func (*MockDBConnector) GetTableClient ¶
func (c *MockDBConnector) GetTableClient() table.Client
func (*MockDBConnector) SelectBackupSchedules ¶
func (c *MockDBConnector) SelectBackupSchedules( _ context.Context, _ queries.ReadTableQuery, ) ([]*types.BackupSchedule, error)
func (*MockDBConnector) SelectBackupSchedulesWithRPOInfo ¶
func (c *MockDBConnector) SelectBackupSchedulesWithRPOInfo( _ context.Context, _ queries.ReadTableQuery, ) ([]*types.BackupSchedule, error)
func (*MockDBConnector) SelectBackups ¶
func (c *MockDBConnector) SelectBackups( _ context.Context, _ queries.ReadTableQuery, ) ([]*types.Backup, error)
func (*MockDBConnector) SelectBackupsByStatus ¶
func (*MockDBConnector) SelectOperations ¶
func (c *MockDBConnector) SelectOperations( _ context.Context, _ queries.ReadTableQuery, ) ([]types.Operation, error)
func (*MockDBConnector) UpdateBackup ¶
func (*MockDBConnector) UpdateOperation ¶
type Option ¶
type Option func(*MockDBConnector)
func WithBackupSchedules ¶
func WithBackupSchedules(backupSchedules map[string]types.BackupSchedule) Option
type YdbConnector ¶
type YdbConnector struct {
// contains filtered or unexported fields
}
func NewYdbConnector ¶
func NewYdbConnector(ctx context.Context, config config.YDBConnectionConfig) (*YdbConnector, error)
func (*YdbConnector) ActiveOperations ¶
func (*YdbConnector) Close ¶
func (d *YdbConnector) Close(ctx context.Context)
func (*YdbConnector) CreateBackup ¶
func (*YdbConnector) CreateOperation ¶
func (*YdbConnector) ExecuteUpsert ¶
func (d *YdbConnector) ExecuteUpsert(ctx context.Context, queryBuilder queries.WriteTableQuery) error
func (*YdbConnector) GetTableClient ¶
func (d *YdbConnector) GetTableClient() table.Client
func (*YdbConnector) SelectBackupSchedules ¶
func (d *YdbConnector) SelectBackupSchedules( ctx context.Context, queryBuilder queries.ReadTableQuery, ) ([]*types.BackupSchedule, error)
func (*YdbConnector) SelectBackupSchedulesWithRPOInfo ¶
func (d *YdbConnector) SelectBackupSchedulesWithRPOInfo( ctx context.Context, queryBuilder queries.ReadTableQuery, ) ([]*types.BackupSchedule, error)
func (*YdbConnector) SelectBackups ¶
func (d *YdbConnector) SelectBackups( ctx context.Context, queryBuilder queries.ReadTableQuery, ) ([]*types.Backup, error)
func (*YdbConnector) SelectOperations ¶
func (d *YdbConnector) SelectOperations( ctx context.Context, queryBuilder queries.ReadTableQuery, ) ([]types.Operation, error)
func (*YdbConnector) UpdateBackup ¶
func (*YdbConnector) UpdateOperation ¶
Click to show internal directories.
Click to hide internal directories.