Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SecretEverything []SecretPermission = []SecretPermission{SecretAccess, SecretPut}
Functions ¶
Types ¶
type Secret ¶
type Secret interface {
// Allow requests the given permissions to the secret.
Allow(permission SecretPermission, permissions ...SecretPermission) *SecretClient
}
type SecretClient ¶
type SecretClient struct {
// contains filtered or unexported fields
}
SecretClient - Reference to a cloud secret
func NewSecretClient ¶
func NewSecretClient(name string) (*SecretClient, error)
func (*SecretClient) Access ¶
func (s *SecretClient) Access(ctx context.Context) (SecretValue, error)
Access - Access the latest version of this secret
func (*SecretClient) AccessVersion ¶
func (s *SecretClient) AccessVersion(ctx context.Context, version string) (SecretValue, error)
AccessVersion - Access a specific version of the secret
func (*SecretClient) Name ¶
func (s *SecretClient) Name() string
Name - Return the name of this secret
type SecretClientIface ¶
type SecretClientIface interface {
// Name - Return the name of this secret
Name() string
// Put - Store a new value in this secret, returning a reference to the new version created
Put(ctx context.Context, value []byte) (string, error)
// Access - Access the latest version of this secret
Access(ctx context.Context) (SecretValue, error)
// AccessVersion - Access a specific version of the secret
AccessVersion(ctx context.Context, version string) (SecretValue, error)
}
type SecretPermission ¶
type SecretPermission string
const ( SecretAccess SecretPermission = "access" SecretPut SecretPermission = "put" )
type SecretValue ¶
type SecretValue []byte
func (SecretValue) AsString ¶
func (s SecretValue) AsString() string
Click to show internal directories.
Click to hide internal directories.