service

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupHandler

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

BackupHandler handles backup-related REST API calls and renders responses either as human-readable tables/sections or as structured slog entries depending on the JSON output flag.

func NewBackupHandler

func NewBackupHandler(serverURL string, logger *slog.Logger, json bool) (*BackupHandler, error)

NewBackupHandler creates a new BackupHandler. The logger and json flag are forwarded to the logging package which selects the appropriate renderer.

func (*BackupHandler) Cancel

func (h *BackupHandler) Cancel(ctx context.Context, name string) error

Cancel cancels a currently running backup for the given routine.

func (*BackupHandler) ListFull

func (h *BackupHandler) ListFull(ctx context.Context, name string, from, to int64) error

ListFull fetches full backups (optionally filtered by routine name and time range) and prints them.

func (*BackupHandler) ListIncremental

func (h *BackupHandler) ListIncremental(ctx context.Context, name string, from, to int64) error

ListIncremental fetches incremental backups (optionally filtered by routine name and time range) and prints them.

func (*BackupHandler) Status

func (h *BackupHandler) Status(ctx context.Context, name string) error

Status fetches the current backup state for the given routine and prints it.

func (*BackupHandler) TriggerFull

func (h *BackupHandler) TriggerFull(ctx context.Context, name string, delay int) error

TriggerFull triggers a full backup for the given routine.

func (*BackupHandler) TriggerIncremental

func (h *BackupHandler) TriggerIncremental(ctx context.Context, name string, delay int) error

TriggerIncremental triggers an incremental backup for the given routine.

type ConfigHandler

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

ConfigHandler handles configuration-related REST API calls under /v1/config and renders responses either as human-readable tables/sections or as structured slog entries depending on the JSON output flag.

func NewConfigHandler

func NewConfigHandler(serverURL string, logger *slog.Logger, json bool) (*ConfigHandler, error)

NewConfigHandler creates a new ConfigHandler. The logger and json flag are forwarded to the logging package which selects the appropriate renderer.

func (*ConfigHandler) AddCluster

func (h *ConfigHandler) AddCluster(ctx context.Context, fields *models.ConfigClusterFields) error

AddCluster adds a new cluster definition built from individual flag fields.

func (*ConfigHandler) AddPolicy

func (h *ConfigHandler) AddPolicy(ctx context.Context, fields *models.ConfigPolicyFields) error

AddPolicy adds a new backup policy built from individual flag fields.

func (*ConfigHandler) AddRoutine

func (h *ConfigHandler) AddRoutine(ctx context.Context, fields *models.ConfigRoutineFields) error

AddRoutine adds a new backup routine built from individual flag fields.

func (*ConfigHandler) AddStorage

func (h *ConfigHandler) AddStorage(ctx context.Context, fields *models.ConfigStorageFields) error

AddStorage adds a new storage entry built from individual flag fields.

func (*ConfigHandler) Apply

func (h *ConfigHandler) Apply(ctx context.Context) error

Apply reloads the configuration from the configuration file on the server.

func (*ConfigHandler) DeleteCluster

func (h *ConfigHandler) DeleteCluster(ctx context.Context, name string) error

DeleteCluster removes a cluster definition by name.

func (*ConfigHandler) DeletePolicy

func (h *ConfigHandler) DeletePolicy(ctx context.Context, name string) error

DeletePolicy removes a backup policy by name.

func (*ConfigHandler) DeleteRoutine

func (h *ConfigHandler) DeleteRoutine(ctx context.Context, name string) error

DeleteRoutine removes a backup routine by name.

func (*ConfigHandler) DeleteStorage

func (h *ConfigHandler) DeleteStorage(ctx context.Context, name string) error

DeleteStorage removes a storage entry by name.

func (*ConfigHandler) DisableRoutine

func (h *ConfigHandler) DisableRoutine(ctx context.Context, name string) error

DisableRoutine disables a backup routine by name.

func (*ConfigHandler) EnableRoutine

func (h *ConfigHandler) EnableRoutine(ctx context.Context, name string) error

EnableRoutine enables a backup routine by name.

func (*ConfigHandler) ListClusters

func (h *ConfigHandler) ListClusters(ctx context.Context) error

ListClusters fetches all configured Aerospike clusters and prints them.

func (*ConfigHandler) ListPolicies

func (h *ConfigHandler) ListPolicies(ctx context.Context) error

ListPolicies fetches all configured backup policies and prints them.

func (*ConfigHandler) ListRoutines

func (h *ConfigHandler) ListRoutines(ctx context.Context) error

ListRoutines fetches all configured backup routines and prints them.

func (*ConfigHandler) ListStorage

func (h *ConfigHandler) ListStorage(ctx context.Context) error

ListStorage fetches all configured storage entries and prints them.

func (*ConfigHandler) Read

func (h *ConfigHandler) Read(ctx context.Context) error

Read fetches the full service configuration and prints it.

func (*ConfigHandler) ReadCluster

func (h *ConfigHandler) ReadCluster(ctx context.Context, name string) error

ReadCluster fetches a single configured cluster by name and prints it.

func (*ConfigHandler) ReadPolicy

func (h *ConfigHandler) ReadPolicy(ctx context.Context, name string) error

ReadPolicy fetches a single backup policy by name and prints it.

func (*ConfigHandler) ReadRoutine

func (h *ConfigHandler) ReadRoutine(ctx context.Context, name string) error

ReadRoutine fetches a single backup routine by name and prints it.

func (*ConfigHandler) ReadStorage

func (h *ConfigHandler) ReadStorage(ctx context.Context, name string) error

ReadStorage fetches a single storage entry by name and prints it.

func (*ConfigHandler) Update

func (h *ConfigHandler) Update(ctx context.Context, file string) error

Update replaces the full service configuration with the body loaded from file.

func (*ConfigHandler) UpdateCluster

func (h *ConfigHandler) UpdateCluster(ctx context.Context, fields *models.ConfigClusterFields) error

UpdateCluster replaces an existing cluster definition with a body built from individual flag fields.

func (*ConfigHandler) UpdatePolicy

func (h *ConfigHandler) UpdatePolicy(ctx context.Context, fields *models.ConfigPolicyFields) error

UpdatePolicy replaces an existing backup policy with a body built from individual flag fields.

func (*ConfigHandler) UpdateRoutine

func (h *ConfigHandler) UpdateRoutine(ctx context.Context, fields *models.ConfigRoutineFields) error

UpdateRoutine replaces an existing backup routine with a body built from individual flag fields.

func (*ConfigHandler) UpdateStorage

func (h *ConfigHandler) UpdateStorage(ctx context.Context, fields *models.ConfigStorageFields) error

UpdateStorage replaces an existing storage entry with a body built from individual flag fields.

type RestoreHandler

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

RestoreHandler handles restore-related REST API calls and renders responses either as human-readable tables/sections or as structured slog entries depending on the JSON output flag.

func NewRestoreHandler

func NewRestoreHandler(serverURL string, logger *slog.Logger, isJSON bool) (*RestoreHandler, error)

NewRestoreHandler creates a new RestoreHandler. The logger and json flag are forwarded to the logging package which selects the appropriate renderer.

func (*RestoreHandler) Cancel

func (h *RestoreHandler) Cancel(ctx context.Context, jobID int64) error

Cancel cancels a running restore operation by job ID.

func (*RestoreHandler) ListJobs

func (h *RestoreHandler) ListJobs(ctx context.Context, from, to int64, status string) error

ListJobs fetches restore jobs (optionally filtered by time range and status) and prints them.

func (*RestoreHandler) RestoreFull

func (h *RestoreHandler) RestoreFull(ctx context.Context, req *models.RestoreRequest) (string, error)

RestoreFull triggers an asynchronous full restore operation. Returns the new job ID (the API responds with a plain integer body) on success.

func (*RestoreHandler) RestoreIncremental

func (h *RestoreHandler) RestoreIncremental(ctx context.Context, req *models.RestoreRequest) (string, error)

RestoreIncremental triggers an asynchronous incremental restore operation. Returns the new job ID on success.

func (*RestoreHandler) RestoreTimestamp

func (h *RestoreHandler) RestoreTimestamp(ctx context.Context, req *models.RestoreTimestampRequest) (string, error)

RestoreTimestamp triggers an asynchronous restore-to-timestamp operation. Returns the new job ID on success.

func (*RestoreHandler) Status

func (h *RestoreHandler) Status(ctx context.Context, jobID int64) error

Status fetches a restore job status by ID and prints it.

Jump to

Keyboard shortcuts

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