secretmanager

package
v0.0.0-...-eaaaabd Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// ProjectID is GCP project in which to store secrets in Secret Manager.
	ProjectID string
	// contains filtered or unexported fields
}

Client is a wrapper of secretmanager client

func NewClient

func NewClient(projectID string, dryrun bool) (*Client, error)

NewClient creates a client for secretmanager, it would fail if not authenticated

func (*Client) AddSecretVersion

func (c *Client) AddSecretVersion(ctx context.Context, secretName string, payload []byte) error

AddSecretVersion adds a secret version, aka update the value of a secret

func (*Client) CreateSecret

func (c *Client) CreateSecret(ctx context.Context, secretID string) (*secretmanagerpb.Secret, error)

CreateSecret creates a secret

func (*Client) ListSecrets

func (c *Client) ListSecrets(ctx context.Context) ([]*secretmanagerpb.Secret, error)

ListSecrets lists all secrets under current project

type ClientInterface

type ClientInterface interface {
	CreateSecret(ctx context.Context, secretID string) (*secretmanagerpb.Secret, error)
	AddSecretVersion(ctx context.Context, secretName string, payload []byte) error
	ListSecrets(ctx context.Context) ([]*secretmanagerpb.Secret, error)
}

ClientInterface is the interface for manipulating secretmanager

Jump to

Keyboard shortcuts

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