Documentation
¶
Overview ¶
Package database holds shared types and helpers for the databases subcommands.
Index ¶
- type Service
- func (s Service) Create(ctx context.Context, name, region, pgVersion, databaseType string) (*apiclient.Database, error)
- func (s Service) CreateBackup(ctx context.Context, databaseName, backupName string) (*apiclient.DatabaseBackup, error)
- func (s Service) CreateBranch(ctx context.Context, databaseName, branchName string, ttlSeconds *int64) (*apiclient.DatabaseBranch, error)
- func (s Service) Delete(ctx context.Context, name string) error
- func (s Service) DeleteBackup(ctx context.Context, databaseName, backupName string) error
- func (s Service) DeleteBranch(ctx context.Context, databaseName, branchName string) error
- func (s Service) ExtendBranch(ctx context.Context, databaseName, branchName string, ttlSeconds int64) (*apiclient.DatabaseBranch, error)
- func (s Service) Get(ctx context.Context, name string) (*apiclient.Database, error)
- func (s Service) GetBackup(ctx context.Context, databaseName, backupName string) (*apiclient.DatabaseBackup, error)
- func (s Service) GetBackupSchedule(ctx context.Context, databaseName string) (*apiclient.DatabaseBackupSchedule, error)
- func (s Service) GetBranch(ctx context.Context, databaseName, branchName string) (*apiclient.DatabaseBranch, error)
- func (s Service) GetRestore(ctx context.Context, databaseName string, restoreID uuid.UUID) (*apiclient.DatabaseRestore, error)
- func (s Service) ListBackups(ctx context.Context, databaseName string) (*apiclient.DatabaseBackupList, error)
- func (s Service) ListBranches(ctx context.Context, databaseName string) ([]apiclient.DatabaseBranch, error)
- func (s Service) ListPage(ctx context.Context, page, limit int) (*apiclient.PaginatedDatabases, error)
- func (s Service) ListRestores(ctx context.Context, databaseName string) (*apiclient.DatabaseRestoreList, error)
- func (s Service) ResetBranch(ctx context.Context, databaseName, branchName string) (*apiclient.DatabaseBranch, error)
- func (s Service) RestoreFromBackup(ctx context.Context, databaseName, backupName string) (*apiclient.DatabaseRestore, error)
- func (s Service) RestoreToPointInTime(ctx context.Context, databaseName string, restoreTo time.Time) (*apiclient.DatabaseRestore, error)
- func (s Service) RotateBranchPassword(ctx context.Context, databaseName, branchName string) (*apiclient.DatabaseBranch, error)
- func (s Service) SetBackupSchedule(ctx context.Context, databaseName string, ...) (*apiclient.DatabaseBackupSchedule, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service performs authenticated Volcano database workflows.
func NewService ¶
func NewService(deps cliruntime.Deps) Service
NewService returns a database service.
func (Service) Create ¶
func (s Service) Create(ctx context.Context, name, region, pgVersion, databaseType string) (*apiclient.Database, error)
Create creates a database in the current project.
func (Service) CreateBackup ¶ added in v0.23.0
func (s Service) CreateBackup(ctx context.Context, databaseName, backupName string) (*apiclient.DatabaseBackup, error)
CreateBackup captures a database as it is now.
func (Service) CreateBranch ¶ added in v0.21.0
func (s Service) CreateBranch(ctx context.Context, databaseName, branchName string, ttlSeconds *int64) (*apiclient.DatabaseBranch, error)
CreateBranch forks a branch off a database in the current project.
func (Service) DeleteBackup ¶ added in v0.23.0
DeleteBackup deletes one backup of a database in the current project.
func (Service) DeleteBranch ¶ added in v0.21.0
DeleteBranch deletes one branch of a database in the current project.
func (Service) ExtendBranch ¶ added in v0.21.0
func (s Service) ExtendBranch(ctx context.Context, databaseName, branchName string, ttlSeconds int64) (*apiclient.DatabaseBranch, error)
ExtendBranch re-arms a branch's lifetime from now.
func (Service) GetBackup ¶ added in v0.23.0
func (s Service) GetBackup(ctx context.Context, databaseName, backupName string) (*apiclient.DatabaseBackup, error)
GetBackup returns one backup of a database in the current project.
func (Service) GetBackupSchedule ¶ added in v0.23.0
func (s Service) GetBackupSchedule(ctx context.Context, databaseName string) (*apiclient.DatabaseBackupSchedule, error)
GetBackupSchedule returns a database's automated backup schedule.
func (Service) GetBranch ¶ added in v0.21.0
func (s Service) GetBranch(ctx context.Context, databaseName, branchName string) (*apiclient.DatabaseBranch, error)
GetBranch returns one branch of a database in the current project.
func (Service) GetRestore ¶ added in v0.23.0
func (s Service) GetRestore(ctx context.Context, databaseName string, restoreID uuid.UUID) (*apiclient.DatabaseRestore, error)
GetRestore returns one restore of a database in the current project.
func (Service) ListBackups ¶ added in v0.23.0
func (s Service) ListBackups(ctx context.Context, databaseName string) (*apiclient.DatabaseBackupList, error)
ListBackups returns a database's backups and its point-in-time restore window.
func (Service) ListBranches ¶ added in v0.21.0
func (s Service) ListBranches(ctx context.Context, databaseName string) ([]apiclient.DatabaseBranch, error)
ListBranches returns every branch of a database in the current project.
func (Service) ListPage ¶
func (s Service) ListPage(ctx context.Context, page, limit int) (*apiclient.PaginatedDatabases, error)
ListPage returns one database page in the current project.
func (Service) ListRestores ¶ added in v0.23.0
func (s Service) ListRestores(ctx context.Context, databaseName string) (*apiclient.DatabaseRestoreList, error)
ListRestores returns a database's restore history, newest first.
func (Service) ResetBranch ¶ added in v0.21.0
func (s Service) ResetBranch(ctx context.Context, databaseName, branchName string) (*apiclient.DatabaseBranch, error)
ResetBranch discards a branch's changes and re-forks it from the parent.
func (Service) RestoreFromBackup ¶ added in v0.23.0
func (s Service) RestoreFromBackup(ctx context.Context, databaseName, backupName string) (*apiclient.DatabaseRestore, error)
RestoreFromBackup replaces a database's data with a named backup.
func (Service) RestoreToPointInTime ¶ added in v0.23.0
func (s Service) RestoreToPointInTime(ctx context.Context, databaseName string, restoreTo time.Time) (*apiclient.DatabaseRestore, error)
RestoreToPointInTime replaces a database's data with its state at restoreTo.
func (Service) RotateBranchPassword ¶ added in v0.21.0
func (s Service) RotateBranchPassword(ctx context.Context, databaseName, branchName string) (*apiclient.DatabaseBranch, error)
RotateBranchPassword rotates the branch role's password, invalidating the previous connection string.
func (Service) SetBackupSchedule ¶ added in v0.23.0
func (s Service) SetBackupSchedule(ctx context.Context, databaseName string, entries []apiclient.DatabaseBackupScheduleEntry) (*apiclient.DatabaseBackupSchedule, error)
SetBackupSchedule replaces a database's automated backup schedule. An empty entries slice stops scheduled backups.