repository

package
v0.113.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Pbkdf2Algorithm = "pbkdf2-sha256-600000"
)

Variables

This section is empty.

Functions

func ConnectToAPIServer

func ConnectToAPIServer(
	ctx context.Context,
	tlsCert,
	userPassphrase,
	hostname,
	serverAddress,
	username string,
	contentCacheMB,
	metadataCacheMB int,
	accessMode AccessMode,
) error

ConnectToAPIServer connects to the Kopia API server running at the given address

func ConnectToKopiaRepository

func ConnectToKopiaRepository(
	ctx context.Context,
	cli kubernetes.Interface,
	namespace,
	pod,
	container string,
	cmdArgs command.RepositoryCommandArgs,
) error

ConnectToKopiaRepository connects to an already existing kopia repository

func ConnectToOrCreateKopiaRepository

func ConnectToOrCreateKopiaRepository(
	ctx context.Context,
	cli kubernetes.Interface,
	namespace,
	pod,
	container string,
	cmdArgs command.RepositoryCommandArgs,
) error

ConnectToOrCreateKopiaRepository connects to a kopia repository if present or creates if not already present

func CreateKopiaRepository

func CreateKopiaRepository(
	ctx context.Context,
	cli kubernetes.Interface,
	namespace,
	pod,
	container string,
	cmdArgs command.RepositoryCommandArgs,
) error

CreateKopiaRepository creates a kopia repository if not already present Returns true if successful or false with an error If the error is an already exists error, returns false with no error

func Open

func Open(ctx context.Context, configFile, password, purpose string) (repo.RepositoryWriter, error)

Open connects to the kopia repository based on the config stored in the config file NOTE: This assumes that `kopia repository connect` has been already run on the machine OR the above Connect function has been used to connect to the repository server

Types

type AccessMode

type AccessMode int

AccessMode defines the types of access levels for a Kopia repository.

const (
	// ReadOnlyAccess indicates that the repository access level is read-only (no modifications expected).
	ReadOnlyAccess AccessMode = iota
	// WriteAccess indicates that the repository access level allows modifications.
	WriteAccess
)

func (AccessMode) IsReadOnly

func (m AccessMode) IsReadOnly() bool

IsReadOnly returns true if repository access mode is Read-only.

func (AccessMode) String

func (m AccessMode) String() string

String returns a string representation of the RepositoryAccessMode type.

Jump to

Keyboard shortcuts

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