-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
59 lines (42 loc) · 1.73 KB
/
types.go
File metadata and controls
59 lines (42 loc) · 1.73 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package omnivault
import "github.com/plexusone/omnivault/vault"
// Re-export types from the vault package for convenience.
// Users can import just "omnivault" instead of "omnivault/vault".
// Vault is the primary interface for secret storage providers.
type Vault = vault.Vault
// ExtendedVault provides additional features beyond the basic Vault interface.
type ExtendedVault = vault.ExtendedVault
// BatchVault provides batch operations for providers that support them.
type BatchVault = vault.BatchVault
// Secret represents a stored secret with its value and metadata.
type Secret = vault.Secret
// Metadata contains additional information about a secret.
type Metadata = vault.Metadata
// Timestamp wraps time.Time to provide custom JSON marshaling.
type Timestamp = vault.Timestamp
// SecretRef is a URI-style reference to a secret.
type SecretRef = vault.SecretRef
// Capabilities indicates what features a provider supports.
type Capabilities = vault.Capabilities
// Version represents a version of a secret.
type Version = vault.Version
// VaultError is a structured error with additional context.
type VaultError = vault.VaultError
// NewSecret creates a new Secret with the given value.
func NewSecret(value string) *Secret {
return &Secret{Value: value}
}
// NewSecretWithFields creates a new Secret with the given fields.
func NewSecretWithFields(fields map[string]string) *Secret {
return &Secret{Fields: fields}
}
// NewSecretBytes creates a new Secret with binary data.
func NewSecretBytes(data []byte) *Secret {
return &Secret{ValueBytes: data}
}
// Now returns a Timestamp for the current time.
func Now() *Timestamp {
return vault.Now()
}
// NewTimestamp creates a Timestamp from a time.Time.
var NewTimestamp = vault.NewTimestamp