registry

package
v0.0.0-...-01ee8fb Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Contains code for dealing with a registry of completed backup information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompletedJob

type CompletedJob struct {
	// The time at which the backup was started.
	StartTime time.Time

	// The name of the backup job.
	Name string

	// The score representing the contents of the backup.
	Score blob.Score
}

A record in the backup registry describing a successful backup job.

type Registry

type Registry interface {
	// Record that the named backup job has completed.
	RecordBackup(ctx context.Context, j CompletedJob) (err error)

	// Return a list of all completed backups.
	ListBackups(ctx context.Context) (jobs []CompletedJob, err error)
}

func NewGCSRegistry

func NewGCSRegistry(
	ctx context.Context,
	bucket gcs.Bucket,
	cryptoPassword string,
	deriver crypto.KeyDeriver) (r Registry, crypter crypto.Crypter, err error)

Create a registry that stores data in the supplied GCS bucket, deriving a crypto key from the supplied password and ensuring that the bucket may not in the future be used with any other key and has not in the past, either. Return a crypter configured to use the key.

Jump to

Keyboard shortcuts

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