Documentation
¶
Index ¶
- func ConnectToRunningInstance(ctx context.Context, deps *Dependencies, instanceName string, ...) (*pgx.Conn, error)
- func GetActiveOffsiteSettingsDecrypted(deps *Dependencies) (*offsite.OffsiteSettings, error)
- func OffsiteApply(deps *Dependencies, params *OffsiteApplyParams) error
- func OffsiteLogs(deps *Dependencies, params *OffsiteLogsParams) ([]offsite.OffsiteLog, error)
- func OffsiteRemove(deps *Dependencies) error
- func StreamInstanceLogs(ctx context.Context, deps *Dependencies, params GetLogsParams, w io.Writer) error
- func TestPostgreSQLConnectivityWithPassword(ctx context.Context, port int, password string) error
- type AddDatabaseUserParams
- type AddDatabaseUserResult
- type BackupRDBMSParams
- type BackupRDBMSResult
- type ConnectOptions
- type ConsistencyCheckOp
- type ConsistencyStatus
- type CreateDatabaseParams
- type CreateDatabaseResult
- type CreateRDBMSOp
- type CreateRDBMSParams
- type CreateRDBMSResult
- type CronBackupCreateOp
- type CronBackupDeleteOp
- type CronBackupListOp
- type CronTaskOp
- type DatabaseInfo
- type DatabaseMeta
- type DeleteDatabaseUserParams
- type DeleteDatabaseUserResult
- type DeleteRDBMSOp
- type DeleteRDBMSParams
- type Dependencies
- type DownloadBackupParams
- type DownloadBackupResult
- type Executor
- func (e *Executor) AddDatabaseUserOp(ctx context.Context, deps *Dependencies, params AddDatabaseUserParams) (*AddDatabaseUserResult, error)
- func (e *Executor) CreateDatabaseOp(ctx context.Context, deps *Dependencies, params CreateDatabaseParams) (*CreateDatabaseResult, error)
- func (e *Executor) DeleteDatabaseUserOp(ctx context.Context, deps *Dependencies, params DeleteDatabaseUserParams) (*DeleteDatabaseUserResult, error)
- func (e *Executor) Execute(ctx context.Context, op Operation) error
- func (e *Executor) ExecuteAsync(ctx context.Context, op Operation) <-chan error
- func (e *Executor) ListDatabasesOp(ctx context.Context, deps *Dependencies, params ListDatabasesParams) (*ListDatabasesResult, error)
- func (e *Executor) ResetDatabaseUserPasswordOp(ctx context.Context, deps *Dependencies, ...) (*ResetDatabaseUserPasswordResult, error)
- type GetLogsParams
- type GetLogsResult
- type GetPasswordOp
- type GetPasswordResult
- type GetRDBMSOp
- type ListBackupsParams
- type ListBackupsResult
- type ListDatabasesParams
- type ListDatabasesResult
- type ListRDBMSOp
- type NotificationAddParams
- type NotificationAddResult
- type NotificationEditParams
- type NotificationEditResult
- type NotificationGetParams
- type NotificationGetResult
- type NotificationListParams
- type NotificationListResult
- type NotificationLogsParams
- type NotificationLogsResult
- type NotificationRemoveParams
- type NotificationRemoveResult
- type NotificationTestParams
- type NotificationTestResult
- type OffsiteApplyParams
- type OffsiteGetResult
- type OffsiteInfoResult
- type OffsiteLogsParams
- type OffsiteTestResult
- type OpType
- type Operation
- type ParameterGroupDeleteParams
- type ParameterGroupDeleteResult
- type ParameterGroupGetParams
- type ParameterGroupGetResult
- type ParameterGroupInfo
- type ParameterGroupListParams
- type ParameterGroupListResult
- type ParameterGroupPutParams
- type ParameterGroupPutResult
- type PostgreSQLStatus
- type PullImageOp
- type PullImageParams
- type PullImageResult
- type ReconfigureRDBMSOp
- type ReconfigureRDBMSParams
- type ReconfigureRDBMSResult
- type RemoveLocalBackupParams
- type RemoveLocalBackupResult
- type RemoveRemoteBackupParams
- type RemoveRemoteBackupResult
- type ResetDatabaseUserPasswordParams
- type ResetDatabaseUserPasswordResult
- type RestoreRDBMSParams
- type RestoreRDBMSResult
- type SetPasswordOp
- type SetPasswordResult
- type SwitchRDBMSOp
- type SwitchRDBMSParams
- type SwitchRDBMSResult
- type UpdateStateOp
- type UpdateStateParams
- type UpgradeRDBMSOp
- type UpgradeRDBMSParams
- type UpgradeRDBMSResult
- type UploadBackupParams
- type UploadBackupResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectToRunningInstance ¶
func ConnectToRunningInstance(ctx context.Context, deps *Dependencies, instanceName string, opts ...ConnectOptions) (*pgx.Conn, error)
ConnectToRunningInstance connects to a PostgreSQL instance, ensuring it's running first
func GetActiveOffsiteSettingsDecrypted ¶
func GetActiveOffsiteSettingsDecrypted(deps *Dependencies) (*offsite.OffsiteSettings, error)
GetActiveOffsiteSettingsDecrypted returns the active offsite settings with the SecretAccessKey decrypted, ready to hand to an S3 client. It returns a copy so the stored ciphertext is never mutated, and never lets the encrypted secret reach an S3 auth path (the bug that left cron remote cleanup unable to delete). For EC2 IAM-role mode (or an empty secret) the secret is left empty. Returns (nil, nil) when no offsite configuration is active.
func OffsiteApply ¶
func OffsiteApply(deps *Dependencies, params *OffsiteApplyParams) error
func OffsiteLogs ¶
func OffsiteLogs(deps *Dependencies, params *OffsiteLogsParams) ([]offsite.OffsiteLog, error)
func OffsiteRemove ¶
func OffsiteRemove(deps *Dependencies) error
func StreamInstanceLogs ¶
func StreamInstanceLogs(ctx context.Context, deps *Dependencies, params GetLogsParams, w io.Writer) error
StreamInstanceLogs streams container logs to w until ctx is cancelled or the container stops.
Types ¶
type AddDatabaseUserParams ¶
type AddDatabaseUserResult ¶
type AddDatabaseUserResult struct {
Username string `json:"username"`
Password string `json:"password"`
Database string `json:"database"`
ReadOnly bool `json:"readOnly"`
Message string `json:"message"`
}
func AddDatabaseUser ¶
func AddDatabaseUser(ctx context.Context, deps *Dependencies, params AddDatabaseUserParams) (*AddDatabaseUserResult, error)
type BackupRDBMSParams ¶
type BackupRDBMSParams struct {
Name string
BackupDir string
Comment string // Optional comment for the backup
}
BackupRDBMSParams contains parameters for backing up an RDBMS instance
type BackupRDBMSResult ¶
BackupRDBMSResult contains the result of backing up an RDBMS instance
func BackupRDBMS ¶
func BackupRDBMS(ctx context.Context, deps *Dependencies, params *BackupRDBMSParams) (*BackupRDBMSResult, error)
BackupRDBMS creates a backup of an RDBMS instance
type ConnectOptions ¶
type ConnectOptions struct {
Database string
}
ConnectOptions allows specifying optional parameters for database connections
type ConsistencyCheckOp ¶
type ConsistencyCheckOp struct {
// contains filtered or unexported fields
}
ConsistencyCheckOp validates RDBMS instance consistency
func NewConsistencyCheckOp ¶
func NewConsistencyCheckOp(deps *Dependencies, instance *instances.RDBMSInstance) *ConsistencyCheckOp
func (*ConsistencyCheckOp) Execute ¶
func (op *ConsistencyCheckOp) Execute(ctx context.Context) error
func (*ConsistencyCheckOp) GetInstance ¶
func (op *ConsistencyCheckOp) GetInstance() *instances.RDBMSInstance
func (*ConsistencyCheckOp) GetStatus ¶
func (op *ConsistencyCheckOp) GetStatus() *ConsistencyStatus
func (*ConsistencyCheckOp) Name ¶
func (op *ConsistencyCheckOp) Name() string
func (*ConsistencyCheckOp) Type ¶
func (op *ConsistencyCheckOp) Type() OpType
type ConsistencyStatus ¶
type ConsistencyStatus struct {
ContainerExists bool
ContainerRunning bool
PostgreSQLReady bool
OverallHealthy bool
Issues []string
}
ConsistencyStatus represents the health status of an RDBMS instance
type CreateDatabaseParams ¶
type CreateDatabaseResult ¶
type CreateDatabaseResult struct {
DatabaseName string `json:"databaseName"`
Message string `json:"message"`
}
func CreateDatabase ¶
func CreateDatabase(ctx context.Context, deps *Dependencies, params CreateDatabaseParams) (*CreateDatabaseResult, error)
type CreateRDBMSOp ¶
type CreateRDBMSOp struct {
// contains filtered or unexported fields
}
CreateRDBMSOp creates a new RDBMS instance
func NewCreateRDBMSOp ¶
func NewCreateRDBMSOp(deps *Dependencies, params CreateRDBMSParams) *CreateRDBMSOp
NewCreateRDBMSOp creates a new create RDBMS operation
func (*CreateRDBMSOp) GetResult ¶
func (op *CreateRDBMSOp) GetResult() *CreateRDBMSResult
GetResult returns the operation result
func (*CreateRDBMSOp) Name ¶
func (op *CreateRDBMSOp) Name() string
func (*CreateRDBMSOp) Type ¶
func (op *CreateRDBMSOp) Type() OpType
type CreateRDBMSParams ¶
type CreateRDBMSParams struct {
Name string
Version string
Image string
Port int
CPUCores int
RAMMB int
ParameterGroup string
}
CreateRDBMSParams contains parameters for creating an RDBMS instance
type CreateRDBMSResult ¶
type CreateRDBMSResult struct {
Instance *instances.RDBMSInstance
Password string // Plaintext password for initial response
}
CreateRDBMSResult contains the result of creating an RDBMS instance
type CronBackupCreateOp ¶
type CronBackupCreateOp struct {
// contains filtered or unexported fields
}
func NewCronBackupCreateOp ¶
func NewCronBackupCreateOp(deps *Dependencies, instanceName string, utcHour, cleanupLocalDays, cleanupRemoteDays int) *CronBackupCreateOp
func (*CronBackupCreateOp) Execute ¶
func (op *CronBackupCreateOp) Execute(ctx context.Context) error
func (*CronBackupCreateOp) GetResult ¶
func (op *CronBackupCreateOp) GetResult() *cron.CronPlan
func (*CronBackupCreateOp) Name ¶
func (op *CronBackupCreateOp) Name() string
func (*CronBackupCreateOp) Type ¶
func (op *CronBackupCreateOp) Type() OpType
type CronBackupDeleteOp ¶
type CronBackupDeleteOp struct {
// contains filtered or unexported fields
}
func NewCronBackupDeleteOp ¶
func NewCronBackupDeleteOp(deps *Dependencies, instanceName string) *CronBackupDeleteOp
func (*CronBackupDeleteOp) Execute ¶
func (op *CronBackupDeleteOp) Execute(ctx context.Context) error
func (*CronBackupDeleteOp) Name ¶
func (op *CronBackupDeleteOp) Name() string
func (*CronBackupDeleteOp) Type ¶
func (op *CronBackupDeleteOp) Type() OpType
type CronBackupListOp ¶
type CronBackupListOp struct {
// contains filtered or unexported fields
}
func NewCronBackupListOp ¶
func NewCronBackupListOp(deps *Dependencies) *CronBackupListOp
func (*CronBackupListOp) GetResult ¶
func (op *CronBackupListOp) GetResult() []*cron.CronPlan
func (*CronBackupListOp) Name ¶
func (op *CronBackupListOp) Name() string
func (*CronBackupListOp) Type ¶
func (op *CronBackupListOp) Type() OpType
type CronTaskOp ¶
type CronTaskOp struct {
// contains filtered or unexported fields
}
func NewCronTaskOp ¶
func NewCronTaskOp(deps *Dependencies, instanceName string) *CronTaskOp
func (*CronTaskOp) Name ¶
func (op *CronTaskOp) Name() string
func (*CronTaskOp) Type ¶
func (op *CronTaskOp) Type() OpType
type DatabaseInfo ¶
type DatabaseMeta ¶
type DatabaseMeta struct {
Name string `json:"name"`
Owner string `json:"owner"`
Encoding string `json:"encoding"`
Collate string `json:"collate"`
Ctype string `json:"ctype"`
LocProvider string `json:"locProvider"` // "c" (libc), "i" (icu), "b" (builtin); "c" assumed pre-PG15
}
DatabaseMeta captures the attributes needed to faithfully recreate a database (its encoding/collation and owner). It is written into the backup archive at backup time and consumed by restore and major-upgrade.
type DeleteDatabaseUserResult ¶
type DeleteDatabaseUserResult struct {
Username string `json:"username"`
Message string `json:"message"`
}
func DeleteDatabaseUser ¶
func DeleteDatabaseUser(ctx context.Context, deps *Dependencies, params DeleteDatabaseUserParams) (*DeleteDatabaseUserResult, error)
type DeleteRDBMSOp ¶
type DeleteRDBMSOp struct {
// contains filtered or unexported fields
}
DeleteRDBMSOp deletes an RDBMS instance
func NewDeleteRDBMSOp ¶
func NewDeleteRDBMSOp(deps *Dependencies, params DeleteRDBMSParams) *DeleteRDBMSOp
func (*DeleteRDBMSOp) Name ¶
func (op *DeleteRDBMSOp) Name() string
func (*DeleteRDBMSOp) Type ¶
func (op *DeleteRDBMSOp) Type() OpType
type DeleteRDBMSParams ¶
type DeleteRDBMSParams struct {
Name string
}
DeleteRDBMSParams contains parameters for deleting an RDBMS instance
type Dependencies ¶
type Dependencies struct {
Store *store.Store
Docker *docker.Client
MasterKey []byte
DataDir string // Added for backup operations
BackupDir string // Added for backup operations
Logger *log.Logger
}
Dependencies holds all the dependencies needed by operations
type DownloadBackupParams ¶
DownloadBackupParams contains parameters for downloading a backup from S3
type DownloadBackupResult ¶
type DownloadBackupResult struct {
Message string `json:"message"`
Location string `json:"location"`
Size int64 `json:"size"`
}
DownloadBackupResult contains the result of downloading a backup
func DownloadBackup ¶
func DownloadBackup(ctx context.Context, deps *Dependencies, params DownloadBackupParams) (*DownloadBackupResult, error)
DownloadBackup downloads a backup from S3 to local storage
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor manages sequential execution of operations
func (*Executor) AddDatabaseUserOp ¶
func (e *Executor) AddDatabaseUserOp(ctx context.Context, deps *Dependencies, params AddDatabaseUserParams) (*AddDatabaseUserResult, error)
AddDatabaseUserOp executes the add database user operation
func (*Executor) CreateDatabaseOp ¶
func (e *Executor) CreateDatabaseOp(ctx context.Context, deps *Dependencies, params CreateDatabaseParams) (*CreateDatabaseResult, error)
CreateDatabaseOp executes the create database operation
func (*Executor) DeleteDatabaseUserOp ¶
func (e *Executor) DeleteDatabaseUserOp(ctx context.Context, deps *Dependencies, params DeleteDatabaseUserParams) (*DeleteDatabaseUserResult, error)
DeleteDatabaseUserOp executes the delete database user operation
func (*Executor) Execute ¶
Execute runs an operation, ensuring sequential execution.
Callers from HTTP handlers should pass context.Background(), not r.Context(): operations are uninterruptible by HTTP client disconnect by design — a half-aborted pg_dump, pg_restore, S3 upload, or container-create would leave debris (orphan helper containers, partial files, inconsistent state). The ctx here is only useful if a caller intentionally wires in cancellation (e.g. a future graceful-shutdown context).
func (*Executor) ExecuteAsync ¶
ExecuteAsync runs an operation asynchronously but still sequentially
func (*Executor) ListDatabasesOp ¶
func (e *Executor) ListDatabasesOp(ctx context.Context, deps *Dependencies, params ListDatabasesParams) (*ListDatabasesResult, error)
ListDatabasesOp executes the list databases operation
func (*Executor) ResetDatabaseUserPasswordOp ¶
func (e *Executor) ResetDatabaseUserPasswordOp(ctx context.Context, deps *Dependencies, params ResetDatabaseUserPasswordParams) (*ResetDatabaseUserPasswordResult, error)
ResetDatabaseUserPasswordOp executes the reset database user password operation
type GetLogsParams ¶
GetLogsParams contains parameters for getting instance logs
type GetLogsResult ¶
type GetLogsResult struct {
Logs string
}
GetLogsResult contains the result of getting instance logs
func GetInstanceLogs ¶
func GetInstanceLogs(ctx context.Context, deps *Dependencies, params GetLogsParams) (*GetLogsResult, error)
GetInstanceLogs fetches the container logs for a given instance
type GetPasswordOp ¶
type GetPasswordOp struct {
// contains filtered or unexported fields
}
GetPasswordOp is an operation to get the decrypted password for an instance
func NewGetPasswordOp ¶
func NewGetPasswordOp(deps *Dependencies, name string) *GetPasswordOp
NewGetPasswordOp creates a new operation to get password
func (*GetPasswordOp) GetResult ¶
func (op *GetPasswordOp) GetResult() *GetPasswordResult
func (*GetPasswordOp) Name ¶
func (op *GetPasswordOp) Name() string
func (*GetPasswordOp) Type ¶
func (op *GetPasswordOp) Type() OpType
type GetPasswordResult ¶
type GetPasswordResult struct {
Password string `json:"password"`
}
type GetRDBMSOp ¶
type GetRDBMSOp struct {
// contains filtered or unexported fields
}
GetRDBMSOp gets a single RDBMS instance
func NewGetRDBMSOp ¶
func NewGetRDBMSOp(deps *Dependencies, name string) *GetRDBMSOp
func (*GetRDBMSOp) GetResult ¶
func (op *GetRDBMSOp) GetResult() *instances.RDBMSInstance
func (*GetRDBMSOp) Name ¶
func (op *GetRDBMSOp) Name() string
func (*GetRDBMSOp) Type ¶
func (op *GetRDBMSOp) Type() OpType
type ListBackupsParams ¶
type ListBackupsParams struct {
InstanceName string
}
ListBackupsParams contains parameters for listing backups
type ListBackupsResult ¶
type ListBackupsResult struct {
Backups []backup.BackupRecord
}
ListBackupsResult contains the result of listing backups
func ListBackups ¶
func ListBackups(ctx context.Context, deps *Dependencies, params ListBackupsParams) (*ListBackupsResult, error)
ListBackups lists all backups for an RDBMS instance with consistency checks If InstanceName is empty, lists all backups across all instances
type ListDatabasesParams ¶
type ListDatabasesParams struct {
InstanceName string
}
type ListDatabasesResult ¶
type ListDatabasesResult struct {
Databases []DatabaseInfo `json:"databases"`
}
func ListDatabases ¶
func ListDatabases(ctx context.Context, deps *Dependencies, params ListDatabasesParams) (*ListDatabasesResult, error)
type ListRDBMSOp ¶
type ListRDBMSOp struct {
// contains filtered or unexported fields
}
ListRDBMSOp lists all RDBMS instances
func NewListRDBMSOp ¶
func NewListRDBMSOp(deps *Dependencies) *ListRDBMSOp
func (*ListRDBMSOp) GetResult ¶
func (op *ListRDBMSOp) GetResult() []instances.RDBMSInstance
func (*ListRDBMSOp) Name ¶
func (op *ListRDBMSOp) Name() string
func (*ListRDBMSOp) Type ¶
func (op *ListRDBMSOp) Type() OpType
type NotificationAddParams ¶
type NotificationAddParams struct {
Name string `json:"name"`
Type notifications.NotificationType `json:"type"`
Config json.RawMessage `json:"config"`
}
type NotificationAddResult ¶
type NotificationAddResult struct {
Notification *notifications.Notification `json:"notification"`
}
func NotificationAdd ¶
func NotificationAdd(ctx context.Context, deps *Dependencies, params NotificationAddParams) (*NotificationAddResult, error)
type NotificationEditParams ¶
type NotificationEditParams struct {
Name string `json:"name"`
Type string `json:"type"`
Config json.RawMessage `json:"config"`
}
type NotificationEditResult ¶
type NotificationEditResult struct {
Notification *notifications.Notification `json:"notification"`
}
func NotificationEdit ¶
func NotificationEdit(ctx context.Context, deps *Dependencies, params NotificationEditParams) (*NotificationEditResult, error)
type NotificationGetParams ¶
type NotificationGetParams struct {
Name string `json:"name"`
}
type NotificationGetResult ¶
type NotificationGetResult struct {
Notification *notifications.Notification `json:"notification"`
}
func NotificationGet ¶
func NotificationGet(ctx context.Context, deps *Dependencies, params NotificationGetParams) (*NotificationGetResult, error)
type NotificationListParams ¶
type NotificationListParams struct{}
type NotificationListResult ¶
type NotificationListResult struct {
Notifications []notifications.Notification `json:"notifications"`
}
func NotificationList ¶
func NotificationList(ctx context.Context, deps *Dependencies, params NotificationListParams) (*NotificationListResult, error)
type NotificationLogsParams ¶
type NotificationLogsParams struct {
Limit int `json:"limit"`
}
type NotificationLogsResult ¶
type NotificationLogsResult struct {
Logs []notifications.NotificationLog `json:"logs"`
}
func NotificationLogs ¶
func NotificationLogs(ctx context.Context, deps *Dependencies, params NotificationLogsParams) (*NotificationLogsResult, error)
type NotificationRemoveParams ¶
type NotificationRemoveParams struct {
Name string `json:"name"`
}
type NotificationRemoveResult ¶
type NotificationRemoveResult struct {
Message string `json:"message"`
}
func NotificationRemove ¶
func NotificationRemove(ctx context.Context, deps *Dependencies, params NotificationRemoveParams) (*NotificationRemoveResult, error)
type NotificationTestParams ¶
type NotificationTestParams struct{}
type NotificationTestResult ¶
type NotificationTestResult struct {
Message string `json:"message"`
}
func NotificationTest ¶
func NotificationTest(ctx context.Context, deps *Dependencies, params NotificationTestParams) (*NotificationTestResult, error)
type OffsiteApplyParams ¶
type OffsiteApplyParams struct {
ConfigJSON []byte
}
type OffsiteGetResult ¶
type OffsiteGetResult struct {
Config offsite.OffsiteSettingsJSON `json:"config"`
}
func OffsiteGet ¶
func OffsiteGet(deps *Dependencies) (*OffsiteGetResult, error)
type OffsiteInfoResult ¶
type OffsiteInfoResult struct {
Active bool `json:"active"`
Config *offsite.OffsiteSettings `json:"config,omitempty"`
}
func OffsiteInfo ¶
func OffsiteInfo(deps *Dependencies) (*OffsiteInfoResult, error)
type OffsiteLogsParams ¶
type OffsiteLogsParams struct {
Limit int
}
type OffsiteTestResult ¶
type OffsiteTestResult struct {
Success bool `json:"success"`
Message string `json:"message"`
Error string `json:"error,omitempty"`
}
func OffsiteTest ¶
func OffsiteTest(deps *Dependencies) (*OffsiteTestResult, error)
type Operation ¶
type Operation interface {
// Name returns a human-readable name for the operation
Name() string
Execute(ctx context.Context) error
// Type returns whether this is a read or write operation
Type() OpType
}
Operation represents a unit of work that can be executed
type ParameterGroupDeleteParams ¶
type ParameterGroupDeleteParams struct {
Name string
}
ParameterGroupDeleteParams contains parameters for deleting a parameter group
type ParameterGroupDeleteResult ¶
type ParameterGroupDeleteResult struct {
Message string `json:"message"`
}
func ParameterGroupDelete ¶
func ParameterGroupDelete(ctx context.Context, deps *Dependencies, params ParameterGroupDeleteParams) (*ParameterGroupDeleteResult, error)
type ParameterGroupGetParams ¶
type ParameterGroupGetParams struct {
Name string
}
ParameterGroupGetParams contains parameters for getting a parameter group
type ParameterGroupGetResult ¶
type ParameterGroupGetResult struct {
GroupName string `json:"groupName"`
Parameters []parameters.ResolvedParameter `json:"parameters"`
}
func ParameterGroupGet ¶
func ParameterGroupGet(ctx context.Context, deps *Dependencies, params ParameterGroupGetParams) (*ParameterGroupGetResult, error)
type ParameterGroupInfo ¶
type ParameterGroupInfo struct {
Name string `json:"name"`
Parameters []parameters.ResolvedParameter `json:"parameters"`
}
type ParameterGroupListParams ¶
type ParameterGroupListParams struct{}
type ParameterGroupListResult ¶
type ParameterGroupListResult struct {
Groups []ParameterGroupInfo `json:"groups"`
}
func ParameterGroupList ¶
func ParameterGroupList(ctx context.Context, deps *Dependencies, params ParameterGroupListParams) (*ParameterGroupListResult, error)
type ParameterGroupPutParams ¶
ParameterGroupPutParams contains parameters for creating a parameter group
type ParameterGroupPutResult ¶
type ParameterGroupPutResult struct {
Message string `json:"message"`
}
func ParameterGroupPut ¶
func ParameterGroupPut(ctx context.Context, deps *Dependencies, params ParameterGroupPutParams) (*ParameterGroupPutResult, error)
type PostgreSQLStatus ¶
type PostgreSQLStatus int
PostgreSQL connectivity status constants
const ( PostgreSQLStatusOK PostgreSQLStatus = iota PostgreSQLStatusBrokenPort PostgreSQLStatusBrokenAuth PostgreSQLStatusOther )
func TestPostgreSQLConnectivity ¶
func TestPostgreSQLConnectivity(ctx context.Context, deps *Dependencies, instanceName string) PostgreSQLStatus
TestPostgreSQLConnectivity tests PostgreSQL connectivity and returns detailed status
type PullImageOp ¶
type PullImageOp struct {
// contains filtered or unexported fields
}
PullImageOp pulls a PostgreSQL image from Docker Hub
func NewPullImageOp ¶
func NewPullImageOp(deps *Dependencies, params PullImageParams) *PullImageOp
NewPullImageOp creates a new pull image operation
func (*PullImageOp) GetResult ¶
func (op *PullImageOp) GetResult() *PullImageResult
GetResult returns the operation result
func (*PullImageOp) Name ¶
func (op *PullImageOp) Name() string
func (*PullImageOp) Type ¶
func (op *PullImageOp) Type() OpType
type PullImageParams ¶
PullImageParams contains parameters for pulling a Docker image
type PullImageResult ¶
PullImageResult contains the result of pulling a Docker image
type ReconfigureRDBMSOp ¶
type ReconfigureRDBMSOp struct {
// contains filtered or unexported fields
}
ReconfigureRDBMSOp reconfigures an existing RDBMS instance with a new parameter group
func NewReconfigureRDBMSOp ¶
func NewReconfigureRDBMSOp(deps *Dependencies, params ReconfigureRDBMSParams) *ReconfigureRDBMSOp
NewReconfigureRDBMSOp creates a new reconfigure RDBMS operation
func (*ReconfigureRDBMSOp) Execute ¶
func (op *ReconfigureRDBMSOp) Execute(ctx context.Context) error
func (*ReconfigureRDBMSOp) GetResult ¶
func (op *ReconfigureRDBMSOp) GetResult() *ReconfigureRDBMSResult
GetResult returns the operation result
func (*ReconfigureRDBMSOp) Name ¶
func (op *ReconfigureRDBMSOp) Name() string
func (*ReconfigureRDBMSOp) Type ¶
func (op *ReconfigureRDBMSOp) Type() OpType
type ReconfigureRDBMSParams ¶
ReconfigureRDBMSParams contains the parameters for reconfiguring an RDBMS instance
type ReconfigureRDBMSResult ¶
type ReconfigureRDBMSResult struct {
Instance *instances.RDBMSInstance
}
ReconfigureRDBMSResult contains the result of reconfiguring an RDBMS instance
type RemoveLocalBackupParams ¶
type RemoveLocalBackupResult ¶
type RemoveLocalBackupResult struct {
Message string `json:"message"`
}
func RemoveLocalBackup ¶
func RemoveLocalBackup(ctx context.Context, deps *Dependencies, params RemoveLocalBackupParams) (*RemoveLocalBackupResult, error)
type RemoveRemoteBackupResult ¶
type RemoveRemoteBackupResult struct {
Message string `json:"message"`
}
func RemoveRemoteBackup ¶
func RemoveRemoteBackup(ctx context.Context, deps *Dependencies, params RemoveRemoteBackupParams) (*RemoveRemoteBackupResult, error)
type ResetDatabaseUserPasswordResult ¶
type ResetDatabaseUserPasswordResult struct {
Username string `json:"username"`
Password string `json:"password"`
Message string `json:"message"`
}
func ResetDatabaseUserPassword ¶
func ResetDatabaseUserPassword(ctx context.Context, deps *Dependencies, params ResetDatabaseUserPasswordParams) (*ResetDatabaseUserPasswordResult, error)
type RestoreRDBMSParams ¶
type RestoreRDBMSParams struct {
// Either BackupID or FilePath must be provided (mutually exclusive)
BackupID int // ID from backup_history table
FilePath string // Direct path to .tar.zst file
InstanceName string // Target instance to restore to
DatabaseName string // Database name inside the backup to restore
RestoreAs string // Optional: restore under a different name
BackupDir string // Backup directory for resolving relative paths
}
RestoreRDBMSParams contains parameters for restoring a database from backup
type RestoreRDBMSResult ¶
type RestoreRDBMSResult struct {
TargetDatabase string `json:"targetDatabase"`
SourceBackup string `json:"sourceBackup"`
Message string `json:"message"`
}
RestoreRDBMSResult contains the result of restoring a database
func RestoreRDBMS ¶
func RestoreRDBMS(ctx context.Context, deps *Dependencies, params *RestoreRDBMSParams) (*RestoreRDBMSResult, error)
RestoreRDBMS restores a single database from a backup archive
type SetPasswordOp ¶
type SetPasswordOp struct {
// contains filtered or unexported fields
}
SetPasswordOp is an operation to set a new password for an instance
func NewSetPasswordOp ¶
func NewSetPasswordOp(deps *Dependencies, name, password string) *SetPasswordOp
NewSetPasswordOp creates a new operation to set password
func (*SetPasswordOp) GetResult ¶
func (op *SetPasswordOp) GetResult() *SetPasswordResult
func (*SetPasswordOp) Name ¶
func (op *SetPasswordOp) Name() string
func (*SetPasswordOp) Type ¶
func (op *SetPasswordOp) Type() OpType
type SetPasswordResult ¶
type SwitchRDBMSOp ¶
type SwitchRDBMSOp struct {
// contains filtered or unexported fields
}
SwitchRDBMSOp switches an existing RDBMS instance to a different Docker image
func NewSwitchRDBMSOp ¶
func NewSwitchRDBMSOp(deps *Dependencies, params SwitchRDBMSParams) *SwitchRDBMSOp
NewSwitchRDBMSOp creates a new switch RDBMS operation
func (*SwitchRDBMSOp) GetResult ¶
func (op *SwitchRDBMSOp) GetResult() *SwitchRDBMSResult
GetResult returns the operation result
func (*SwitchRDBMSOp) Name ¶
func (op *SwitchRDBMSOp) Name() string
func (*SwitchRDBMSOp) Type ¶
func (op *SwitchRDBMSOp) Type() OpType
type SwitchRDBMSParams ¶
type SwitchRDBMSParams struct {
Name string
Image string
Version string // empty = keep current instance version
}
SwitchRDBMSParams contains parameters for switching an instance's image
type SwitchRDBMSResult ¶
type SwitchRDBMSResult struct {
Instance *instances.RDBMSInstance
}
SwitchRDBMSResult contains the result of switching an instance's image
type UpdateStateOp ¶
type UpdateStateOp struct {
// contains filtered or unexported fields
}
UpdateStateOp updates the state of an RDBMS instance
func NewUpdateStateOp ¶
func NewUpdateStateOp(deps *Dependencies, params UpdateStateParams) *UpdateStateOp
func (*UpdateStateOp) Name ¶
func (op *UpdateStateOp) Name() string
func (*UpdateStateOp) Type ¶
func (op *UpdateStateOp) Type() OpType
type UpdateStateParams ¶
UpdateStateParams contains parameters for updating instance state
type UpgradeRDBMSOp ¶
type UpgradeRDBMSOp struct {
// contains filtered or unexported fields
}
UpgradeRDBMSOp performs a major-version PostgreSQL upgrade of an instance using a logical dump/restore: it takes a verified full backup, destroys the old cluster volume, creates a fresh cluster at the target version (which automatically picks the correct data-dir mount for the major), then replays globals and every database into it.
A newer PostgreSQL server cannot start against an older major's data directory, so an in-place restart is impossible; dump/restore is the only universal path that also works with custom images (pgvector, postgis) where pg_upgrade would need both majors' binaries in one image.
func NewUpgradeRDBMSOp ¶
func NewUpgradeRDBMSOp(deps *Dependencies, params UpgradeRDBMSParams) *UpgradeRDBMSOp
NewUpgradeRDBMSOp creates a new major-upgrade operation
func (*UpgradeRDBMSOp) GetResult ¶
func (op *UpgradeRDBMSOp) GetResult() *UpgradeRDBMSResult
GetResult returns the operation result
func (*UpgradeRDBMSOp) Name ¶
func (op *UpgradeRDBMSOp) Name() string
func (*UpgradeRDBMSOp) Type ¶
func (op *UpgradeRDBMSOp) Type() OpType
type UpgradeRDBMSParams ¶
type UpgradeRDBMSParams struct {
Name string
TargetVersion string // target PostgreSQL major version, e.g. "18"
Image string // optional target image; required for custom (non-postgres:) images
}
UpgradeRDBMSParams contains parameters for a major-version upgrade of an instance
type UpgradeRDBMSResult ¶
type UpgradeRDBMSResult struct {
Instance *instances.RDBMSInstance `json:"instance"`
FromVersion string `json:"fromVersion"`
ToVersion string `json:"toVersion"`
BackupID int `json:"backupId"`
DatabasesRestored int `json:"databasesRestored"`
}
UpgradeRDBMSResult contains the result of a major-version upgrade
type UploadBackupParams ¶
UploadBackupParams contains parameters for uploading a backup to S3
type UploadBackupResult ¶
UploadBackupResult contains the result of uploading a backup
func UploadBackup ¶
func UploadBackup(ctx context.Context, deps *Dependencies, params UploadBackupParams) (*UploadBackupResult, error)
UploadBackup uploads a backup to S3
Source Files
¶
- backup_remove_local.go
- cron_backup_create.go
- cron_backup_delete.go
- cron_backup_list.go
- cron_task.go
- database_metadata.go
- executor.go
- notification_add.go
- notification_edit.go
- notification_get.go
- notification_list.go
- notification_logs.go
- notification_remove.go
- notification_verify.go
- offsite.go
- parameter_group_delete.go
- parameter_group_get.go
- parameter_group_list.go
- parameter_group_put.go
- postgres_helpers.go
- pull_image.go
- rdbms_add_database_user.go
- rdbms_backup.go
- rdbms_consistency_check.go
- rdbms_create.go
- rdbms_create_database.go
- rdbms_delete.go
- rdbms_delete_database_user.go
- rdbms_download_backup.go
- rdbms_get.go
- rdbms_get_password.go
- rdbms_list.go
- rdbms_list_backups.go
- rdbms_list_databases.go
- rdbms_logs.go
- rdbms_major_upgrade.go
- rdbms_reconfigure.go
- rdbms_reset_database_user_password.go
- rdbms_restore.go
- rdbms_set_password.go
- rdbms_switch.go
- rdbms_update_state.go
- rdbms_upload_backup.go
- types.go