-
Notifications
You must be signed in to change notification settings - Fork 16
/
secrets.go
35 lines (24 loc) · 974 Bytes
/
secrets.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 stores
import (
"context"
"github.com/consensys/quorum-key-manager/src/stores/entities"
)
//go:generate mockgen -source=secrets.go -destination=mock/secrets.go -package=mock
type SecretStore interface {
// Set secret
Set(ctx context.Context, id, value string, attr *entities.Attributes) (*entities.Secret, error)
// Get a secret
Get(ctx context.Context, id string, version string) (*entities.Secret, error)
// List secrets
List(ctx context.Context, limit, offset uint64) ([]string, error)
// Delete secret not permanently, it can be restored
Delete(ctx context.Context, id string) error
// GetDeleted secrets
GetDeleted(ctx context.Context, id string) (*entities.Secret, error)
// ListDeleted secrets
ListDeleted(ctx context.Context, limit, offset uint64) ([]string, error)
// Restore a previously deleted secret
Restore(ctx context.Context, id string) error
// Destroy secret permanently
Destroy(ctx context.Context, id string) error
}