secrets

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewSecret

func NewSecret(name string) *secret

NewSecret - Create a new Secret resource

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

func (*SecretClient) Put

func (s *SecretClient) Put(ctx context.Context, value []byte) (string, error)

Put - Store a new value in this secret, returning a reference to the new version created

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL