secret

package
v0.0.0-...-13f153f Latest Latest
Warning

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

Go to latest
Published: May 3, 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)

	// Create a new secret in the given project with the given name.
	Create(ctx context.Context, project, name string) error

	// GrantAccess grants the given service account access to the given secret.
	GrantAccess(ctx context.Context, project, name, serviceAccount string) error

	// RevokeAccess revokes the given service account's access to the given
	// secret.
	RevokeAccess(ctx context.Context, project, name, serviceAccount string) 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) Create

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

Create 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) GrantAccess

func (c *ClientImpl) GrantAccess(ctx context.Context, project, name, serviceAccount string) error

GrantAccess implements the Client interface.

func (*ClientImpl) RevokeAccess

func (c *ClientImpl) RevokeAccess(ctx context.Context, project, name, serviceAccount string) error

RevokeAccess 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