mirror of
https://github.com/kopia/kopia.git
synced 2026-03-15 04:38:56 -04:00
rename
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
minLocatorSizeBytes = 16
|
||||
)
|
||||
|
||||
// ObjectReader allows reading, seeking and closing of a repository object.
|
||||
type ObjectReader interface {
|
||||
io.Reader
|
||||
io.Seeker
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user