-
Notifications
You must be signed in to change notification settings - Fork 3
/
storage.go
35 lines (27 loc) · 989 Bytes
/
storage.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package storage_vault
// storageVault ...
type StorageVault interface {
// HeadObject a boolean value whether object name existing in storage.
HeadObject(key string) (bool, string, error)
// PutObject stores the data to the storage backend.
PutObject(key string, data []byte) error
// GetObject downloads the object by name in storage.
GetObject(key string) ([]byte, error)
// SetCredential sets a new credential with backend credential not constant.
RefreshCredential(credential Credential) error
// ID return id of storage vault
ID() (string, string)
// Type
Type() Type
}
type Type struct {
StorageVaultType string
CredentialType string
}
type Credential struct {
AwsAccessKeyId string `json:"aws_access_key_id,omitempty"`
AwsSecretAccessKey string `json:"aws_secret_access_key,omitempty"`
AwsLocation string `json:"aws_location,omitempty"`
Token string `json:"token,omitempty"`
Region string `json:"region,omitempty"`
}