repo

package
v0.3.0-pre9 Latest Latest
Warning

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

Go to latest
Published: May 31, 2019 License: Apache-2.0 Imports: 24 Imported by: 13

Documentation

Overview

Package repo implements content-addressable Repository on top of BLOB storage.

Index

Constants

View Source
const FormatBlockID = "kopia.repository"

FormatBlockID is the identifier of a storage block that describes repository format.

Variables

View Source
var (
	BuildInfo    = "unknown"
	BuildVersion = "v0-unofficial"
)

BuildInfo is the build information of Kopia.

Functions

func Connect

func Connect(ctx context.Context, configFile string, st storage.Storage, password string, opt ConnectOptions) error

Connect connects to the repository in the specified storage and persists the configuration and credentials in the file provided.

func Disconnect

func Disconnect(configFile string) error

Disconnect removes the specified configuration file and any local cache directories.

func Initialize

func Initialize(ctx context.Context, st storage.Storage, opt *NewRepositoryOptions, password string) error

Initialize creates initial repository data structures in the specified storage with given credentials.

func RecoverFormatBlock

func RecoverFormatBlock(ctx context.Context, st storage.Storage, filename string, optionalLength int64) ([]byte, error)

RecoverFormatBlock attempts to recover format block replica from the specified file. The format block can be either the prefix or a suffix of the given file. optionally the length can be provided (if known) to speed up recovery.

func SetCachingConfig

func SetCachingConfig(ctx context.Context, configFile string, opt block.CachingOptions) error

SetCachingConfig changes caching configuration for a given repository config file.

Types

type ConnectOptions

type ConnectOptions struct {
	block.CachingOptions
}

ConnectOptions specifies options when persisting configuration to connect to a repository.

type LocalConfig

type LocalConfig struct {
	Storage storage.ConnectionInfo `json:"storage"`
	Caching block.CachingOptions   `json:"caching"`
}

LocalConfig is a configuration of Kopia stored in a configuration file.

func (*LocalConfig) Load

func (lc *LocalConfig) Load(r io.Reader) error

Load reads local configuration from the specified reader.

func (*LocalConfig) Save

func (lc *LocalConfig) Save(w io.Writer) error

Save writes the configuration to the specified writer.

type NewRepositoryOptions

type NewRepositoryOptions struct {
	UniqueID     []byte // force the use of particular unique ID
	BlockFormat  block.FormattingOptions
	DisableHMAC  bool
	ObjectFormat object.Format // object format
}

NewRepositoryOptions specifies options that apply to newly created repositories. All fields are optional, when not provided, reasonable defaults will be used.

type Options

type Options struct {
	TraceStorage         func(f string, args ...interface{}) // Logs all storage access using provided Printf-style function
	ObjectManagerOptions object.ManagerOptions
}

Options provides configuration parameters for connection to a repository.

type Repository

type Repository struct {
	Blocks    *block.Manager
	Objects   *object.Manager
	Storage   storage.Storage
	Manifests *manifest.Manager
	UniqueID  []byte

	ConfigFile     string
	CacheDirectory string
	// contains filtered or unexported fields
}

Repository represents storage where both content-addressable and user-addressable data is kept.

func Open

func Open(ctx context.Context, configFile string, password string, options *Options) (rep *Repository, err error)

Open opens a Repository specified in the configuration file.

func OpenWithConfig

func OpenWithConfig(ctx context.Context, st storage.Storage, lc *LocalConfig, password string, options *Options, caching block.CachingOptions) (*Repository, error)

OpenWithConfig opens the repository with a given configuration, avoiding the need for a config file.

func (*Repository) Close

func (r *Repository) Close(ctx context.Context) error

Close closes the repository and releases all resources.

func (*Repository) Flush

func (r *Repository) Flush(ctx context.Context) error

Flush waits for all in-flight writes to complete.

func (*Repository) Refresh

func (r *Repository) Refresh(ctx context.Context) error

Refresh periodically makes external changes visible to repository.

func (*Repository) RefreshPeriodically

func (r *Repository) RefreshPeriodically(ctx context.Context, interval time.Duration)

RefreshPeriodically periodically refreshes the repository to reflect the changes made by other hosts.

func (*Repository) Upgrade

func (r *Repository) Upgrade(ctx context.Context) error

Upgrade upgrades repository data structures to the latest version.

Directories

Path Synopsis
Package block implements repository support content-addressable storage blocks.
Package block implements repository support content-addressable storage blocks.
Package manifest implements support for managing JSON-based manifests in repository.
Package manifest implements support for managing JSON-based manifests in repository.
Package object implements repository support for content-addressable objects of arbitrary size.
Package object implements repository support for content-addressable objects of arbitrary size.
Package storage implements simple storage of immutable, unstructured binary large objects (BLOBs).
Package storage implements simple storage of immutable, unstructured binary large objects (BLOBs).
filesystem
Package filesystem implements filesystem-based Storage.
Package filesystem implements filesystem-based Storage.
gcs
Package gcs implements Storage based on Google Cloud Storage bucket.
Package gcs implements Storage based on Google Cloud Storage bucket.
logging
Package logging implements wrapper around Storage that logs all activity.
Package logging implements wrapper around Storage that logs all activity.
providers
Package providers registers all storage providers that are included as part of Kopia.
Package providers registers all storage providers that are included as part of Kopia.
s3
Package s3 implements Storage based on an S3 bucket.
Package s3 implements Storage based on an S3 bucket.
webdav
Package webdav implements WebDAV-based Storage.
Package webdav implements WebDAV-based Storage.

Jump to

Keyboard shortcuts

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