secret

package
v0.0.0-...-b04d5d2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VersionLatest can be provided to Get() in order to retrieve the most recent
	// version of a secret.
	VersionLatest = "latest"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Get the value of the given secret at the given version.  Use "latest" to
	// retrieve the most recent version.
	Get(ctx context.Context, project, secret, version string) (string, error)

	// Update the given secret with a new version. Returns the resulting version.
	Update(ctx context.Context, project, name, value string) (string, error)

	// Describe returns metadata about the secret.
	Describe(ctx context.Context, project, name string) (*secretmanagerpb.Secret, error)

	// Close cleans up resources used by the Client.
	Close() error
}

Client provides functionality for working with GCP Secrets.

type ClientImpl

type ClientImpl struct {
	// contains filtered or unexported fields
}

ClientImpl implements Client.

func NewClient

func NewClient(ctx context.Context) (*ClientImpl, error)

NewClient returns a Client instance.

func (*ClientImpl) Close

func (c *ClientImpl) Close() error

Close implements the Client interface.

func (*ClientImpl) Describe

func (c *ClientImpl) Describe(ctx context.Context, project, name string) (*secretmanagerpb.Secret, error)

Describe implements the Client interface.

func (*ClientImpl) Get

func (c *ClientImpl) Get(ctx context.Context, project, secret, version string) (string, error)

Get implements the Client interface.

func (*ClientImpl) Update

func (c *ClientImpl) Update(ctx context.Context, project, name, value string) (string, error)

Update implements the Client interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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