backup

package
v0.0.0-...-8d15c5f Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBackupNotFound = errors.New("backup not found")
View Source
var ErrCuratorUnavailable = errors.New("curator return internal server error")

Functions

This section is empty.

Types

type ActionTrack

type ActionTrack struct {
	Action        string            `json:"action"`
	Details       TrackDetails      `json:"details"`
	Status        string            `json:"status"`
	TrackID       string            `json:"trackId"`
	ChangedNameDb map[string]string `json:"changedNameDb"`
	TrackPath     *string           `json:"trackPath"` // would be nil in case if names regeneration not requested
}

type BackupProvider

type BackupProvider struct {
	Curator *Curator
	// contains filtered or unexported fields
}

func NewBackupProvider

func NewBackupProvider(opensearchClient common.Client, curatorClient *http.Client, repoRoot string) *BackupProvider

func (BackupProvider) CollectBackup

func (bp BackupProvider) CollectBackup(dbs []string, ctx context.Context) (string, error)

func (BackupProvider) CollectBackupHandler

func (bp BackupProvider) CollectBackupHandler() func(w http.ResponseWriter, r *http.Request)

func (BackupProvider) DeleteBackup

func (bp BackupProvider) DeleteBackup(backupID string, ctx context.Context) ([]byte, int, error)

func (BackupProvider) DeleteBackupHandler

func (bp BackupProvider) DeleteBackupHandler() func(w http.ResponseWriter, r *http.Request)

func (BackupProvider) ProcessRestorationRequest

func (bp BackupProvider) ProcessRestorationRequest(backupId string, restorationRequest RestorationRequest, ctx context.Context) (map[string]string, error, string)

func (BackupProvider) RestorationBackupHandler

func (bp BackupProvider) RestorationBackupHandler(repo string, basePath string) func(w http.ResponseWriter, r *http.Request)

func (BackupProvider) RestoreBackup

func (bp BackupProvider) RestoreBackup(backupId string, dbs []string, fromRepo string, regenerateNames bool, ctx context.Context) (map[string]string, error)

func (BackupProvider) RestoreBackupHandler

func (bp BackupProvider) RestoreBackupHandler(repo string, basePath string) func(w http.ResponseWriter, r *http.Request)

func (BackupProvider) TrackBackup

func (bp BackupProvider) TrackBackup(backupID string, ctx context.Context) (ActionTrack, error)

func (BackupProvider) TrackBackupHandler

func (bp BackupProvider) TrackBackupHandler() func(w http.ResponseWriter, r *http.Request)

func (BackupProvider) TrackRestore

func (bp BackupProvider) TrackRestore(trackId string, ctx context.Context, changedNameDb map[string]string) (ActionTrack, error)

func (BackupProvider) TrackRestoreFromIndicesHandler

func (bp BackupProvider) TrackRestoreFromIndicesHandler(fromRepo string) func(w http.ResponseWriter, r *http.Request)

func (BackupProvider) TrackRestoreFromTrackIdHandler

func (bp BackupProvider) TrackRestoreFromTrackIdHandler(fromRepo string) func(w http.ResponseWriter, r *http.Request)

func (BackupProvider) TrackRestoreIndices

func (bp BackupProvider) TrackRestoreIndices(ctx context.Context, backupId string, indices []string, repoName string, changedNameDb map[string]string) ActionTrack

TrackRestoreIndices We keep this logic, but first we need to fix the problem with users and regenerate names for indexes, until then it will not work incorrectly.

type Curator

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

type Database

type Database struct {
	Namespace    string `json:"namespace"`
	Microservice string `json:"microservice"`
	Name         string `json:"name"`
	Prefix       string `json:"prefix,omitempty"`
}

type IndexRecoveryInfo

type IndexRecoveryInfo struct {
	Shards []ShardRecoveryInfo
}

type JobStatus

type JobStatus struct {
	State   string `json:"status"`
	Message string `json:"details,omitempty"`
	Vault   string `json:"vault"`
	Type    string `json:"type"`
	Error   string `json:"err,omitempty"`
	TaskId  string `json:"trackPath"`
}

type RecoveryInfo

type RecoveryInfo map[string]IndexRecoveryInfo

type RecoverySourceInfo

type RecoverySourceInfo struct {
	Snapshot   string
	Repository string
	Index      string
}

type Repository

type Repository struct {
	Status int `json:"status"`
}

type RestorationRequest

type RestorationRequest struct {
	Databases       []Database `json:"databases"`
	RegenerateNames bool       `json:"regenerateNames,omitempty"`
}

type ShardRecoveryInfo

type ShardRecoveryInfo struct {
	Type   string
	Stage  string
	Source RecoverySourceInfo
}

type SnapshotStatus

type SnapshotStatus struct {
	State    string
	Snapshot string
	Indices  map[string]interface{}
}

type Snapshots

type Snapshots struct {
	Snapshots []SnapshotStatus
}

type TrackDetails

type TrackDetails struct {
	LocalId string `json:"localId"`
}

Jump to

Keyboard shortcuts

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