diff --git a/blob/storage.go b/blob/storage.go index a7ab8e30e..f6278b3b8 100644 --- a/blob/storage.go +++ b/blob/storage.go @@ -29,7 +29,7 @@ type Flusher interface { Flush() error } -// ConnectionInfoProvider exposes persistent ConnectionInfo for connecting to the storage. +// ConnectionInfoProvider exposes persistent ConnectionInfo for connecting to the Storage. type ConnectionInfoProvider interface { ConnectionInfo() ConnectionInfo } diff --git a/cmd/kopia/command_create.go b/cmd/kopia/command_create.go index c2f01ad3f..1952e718b 100644 --- a/cmd/kopia/command_create.go +++ b/cmd/kopia/command_create.go @@ -129,8 +129,8 @@ func runCreateCommand(context *kingpin.ParseContext) error { } if err := vlt.SetRepository(vault.RepositoryConfig{ - Storage: cip.ConnectionInfo(), - Format: repoFormat, + Connection: cip.ConnectionInfo(), + Format: repoFormat, }); err != nil { return fmt.Errorf("unable to save repository configuration in vault: %v", err) } diff --git a/repo/repository.go b/repo/repository.go index fbf2c880b..73d0f38d3 100644 --- a/repo/repository.go +++ b/repo/repository.go @@ -21,6 +21,7 @@ minLocatorSizeBytes = 16 ) +// ObjectReader allows reading, seeking and closing of a repository object. type ObjectReader interface { io.Reader io.Seeker diff --git a/vault/format.go b/vault/format.go index ed96e8deb..9c9bfde78 100644 --- a/vault/format.go +++ b/vault/format.go @@ -38,6 +38,6 @@ func (f *Format) ensureUniqueID() error { } type RepositoryConfig struct { - Storage blob.ConnectionInfo `json:"storage"` - Format *repo.Format `json:"repository"` + Connection blob.ConnectionInfo `json:"connection"` + Format *repo.Format `json:"format"` } diff --git a/vault/vault.go b/vault/vault.go index 59b6d78b2..88614af31 100644 --- a/vault/vault.go +++ b/vault/vault.go @@ -188,7 +188,7 @@ func (v *Vault) OpenRepository() (repo.Repository, error) { return nil, err } - storage, err := blob.NewStorage(rc.Storage) + storage, err := blob.NewStorage(rc.Connection) if err != nil { return nil, fmt.Errorf("unable to open repository: %v", err) } @@ -232,8 +232,8 @@ func (v *Vault) List(prefix string) ([]string, error) { } type vaultConfig struct { - Connection blob.ConnectionInfo `json:"connection"` - Key []byte `json:"key,omitempty"` + ConnectionInfo blob.ConnectionInfo `json:"connection"` + Key []byte `json:"key,omitempty"` } // Token returns a persistent opaque string that encodes the configuration of vault storage @@ -245,8 +245,8 @@ func (v *Vault) Token() (string, error) { } vc := vaultConfig{ - Connection: cip.ConnectionInfo(), - Key: v.masterKey, + ConnectionInfo: cip.ConnectionInfo(), + Key: v.masterKey, } b, err := json.Marshal(&vc) @@ -385,7 +385,7 @@ func OpenWithToken(token string) (*Vault, error) { return nil, fmt.Errorf("invalid vault token") } - st, err := blob.NewStorage(vc.Connection) + st, err := blob.NewStorage(vc.ConnectionInfo) if err != nil { return nil, fmt.Errorf("cannot open vault storage: %v", err) }