forked from influxdata/influxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
secret.go
27 lines (19 loc) · 1.09 KB
/
secret.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
package influxdb
import "context"
// ErrSecretNotFound is the error msg for a missing secret.
const ErrSecretNotFound = "secret not found"
// SecretService a service for storing and retrieving secrets.
type SecretService interface {
// LoadSecret retrieves the secret value v found at key k for organization orgID.
LoadSecret(ctx context.Context, orgID ID, k string) (string, error)
// GetSecretKeys retrieves all secret keys that are stored for the organization orgID.
GetSecretKeys(ctx context.Context, orgID ID) ([]string, error)
// PutSecret stores the secret pair (k,v) for the organization orgID.
PutSecret(ctx context.Context, orgID ID, k string, v string) error
// PutSecrets puts all provided secrets and overwrites any previous values.
PutSecrets(ctx context.Context, orgID ID, m map[string]string) error
// PatchSecrets patches all provided secrets and updates any previous values.
PatchSecrets(ctx context.Context, orgID ID, m map[string]string) error
// DeleteSecret removes a single secret from the secret store.
DeleteSecret(ctx context.Context, orgID ID, ks ...string) error
}