Documentation ¶
Overview ¶
Package repo implements content-addressable Repository on top of BLOB storage.
Index ¶
- Constants
- Variables
- func Connect(ctx context.Context, configFile string, st storage.Storage, password string, ...) error
- func Disconnect(configFile string) error
- func Initialize(ctx context.Context, st storage.Storage, opt *NewRepositoryOptions, ...) error
- func RecoverFormatBlock(ctx context.Context, st storage.Storage, filename string, optionalLength int64) ([]byte, error)
- func SetCachingConfig(ctx context.Context, configFile string, opt block.CachingOptions) error
- type ConnectOptions
- type LocalConfig
- type NewRepositoryOptions
- type Options
- type Repository
- func (r *Repository) Close(ctx context.Context) error
- func (r *Repository) Flush(ctx context.Context) error
- func (r *Repository) Refresh(ctx context.Context) error
- func (r *Repository) RefreshPeriodically(ctx context.Context, interval time.Duration)
- func (r *Repository) Upgrade(ctx context.Context) error
Constants ¶
const FormatBlockID = "kopia.repository"
FormatBlockID is the identifier of a storage block that describes repository format.
Variables ¶
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 ¶
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 ¶
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.
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.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package block implements repository support content-addressable storage blocks.
|
Package block implements repository support content-addressable storage blocks. |
examples
|
|
upload_download
Command repository_api demonstrates the use of Kopia's Repository API.
|
Command repository_api demonstrates the use of Kopia's Repository API. |
internal
|
|
repologging
Package repologging provides loggers.
|
Package repologging provides loggers. |
repotesting
Package repotesting contains test utilities for working with repositories.
|
Package repotesting contains test utilities for working with repositories. |
retry
Package retry implements exponential retry policy.
|
Package retry implements exponential retry policy. |
storagetesting
Package storagetesting is used for testing Storage implementations.
|
Package storagetesting is used for testing Storage implementations. |
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. |
tests
|
|