transfer

package
v0.0.0-...-3bfe646 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportSite

func ExportSite(site *storage.Site, src ExportBackend, tempDir string, clusters []storage.TrustedCluster) (io.ReadCloser, error)

ExportSite transfers site state from specified site into a temporary file and returns a reader to it. tempDir defines the temporary working directory and should not be deleted by caller until returned ReadCloser is closed

func ImportSite

func ImportSite(path string, dst storage.Backend) error

ImportSite imports site state from the specified path into the provided backend.

Types

type ExportBackend

type ExportBackend interface {
	GetAccount(accountID string) (*storage.Account, error)
	GetSiteUsers(domain string) ([]storage.User, error)
	GetPackage(repository, packageName, packageVersion string) (*storage.Package, error)
	GetAPIKeys(email string) ([]storage.APIKey, error)
	GetUserRoles(email string) ([]teleservices.Role, error)
	GetSiteOperations(domain string) ([]storage.SiteOperation, error)
	GetTrustedClusters() ([]teleservices.TrustedCluster, error)
	GetSiteProvisioningTokens(domain string) ([]storage.ProvisioningToken, error)
	GetLastProgressEntry(domain, operationID string) (*storage.ProgressEntry, error)
	GetOperationPlan(domain, operationID string) (*storage.OperationPlan, error)
}

ExportBackend exposes a subset of storage.Backend to perform site export.

This interface defines a facade to provide alternate implementations of (some of) the Backend methods used in export.

Jump to

Keyboard shortcuts

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