backup

package
v2.3.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2019 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package backup handle data backup/restore to/from ZIP format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExportSpec

type ExportSpec struct {
	// A value of "*' means all tenants/oragnizations are backed up (requires global admin permission).
	// A genuine ID means only that specific organization is backed up.
	OrgID string `json:"org"`

	// Retain will keep the backup file on disk after operation is complete.
	// File is located in the same folder as the running executable.
	Retain bool `json:"retain"`
}

ExportSpec controls what data is exported to the backup file.

func (*ExportSpec) SystemBackup

func (e *ExportSpec) SystemBackup() bool

SystemBackup happens if org ID is "*".

type ImportSpec

type ImportSpec struct {
	// Overwrite current organization settings.
	OverwriteOrg bool `json:"overwriteOrg"`

	// As found in backup file.
	Manifest Manifest

	// Handle to the current organization being used for restore process.
	Org org.Organization

	// Was the backup file for a global system backup?
	// TRUE if Manifest.Org = "*".
	GlobalBackup bool
}

ImportSpec controls what content is imported and how.

type Manifest

type Manifest struct {
	// ID is unique per backup.
	ID string `json:"id"`

	// A value of "*' means all tenants/oragnizations are backed up (requires global admin permission).
	// A genuine ID means only that specific organization is backed up.
	OrgID string `json:"org"`

	// Product edition at the time of the backup.
	Edition domain.Edition `json:"edition"`

	// When the backup took place.
	Created time.Time `json:"created"`

	// Product version at the time of the backup.
	Major    string `json:"major"`
	Minor    string `json:"minor"`
	Patch    string `json:"patch"`
	Revision string `json:"revision"`
	Version  string `json:"version"`

	// Database provider used by source system.
	StoreType env.StoreType `json:"storeType"`
}

Manifest contains backup meta information.

type User

type User struct {
	model.BaseEntity
	Firstname   string `json:"firstname"`
	Lastname    string `json:"lastname"`
	Email       string `json:"email"`
	Initials    string `json:"initials"`
	Active      bool   `json:"active"`
	GlobalAdmin bool   `json:"global"`
	Password    string `json:"password"`
	Salt        string `json:"salt"`
	Reset       string `json:"reset"`
	LastVersion string `json:"lastVersion"`
}

User represents user object for backup/restore operations. We include user specific secrets in such operations.

Jump to

Keyboard shortcuts

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