google

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound   = errors.New("secret not found")
	ErrInvalidURL = fmt.Errorf("invalid URL (should be formatted %s or %s)", shortFormURL, longFormURL)
)

Functions

func GSMStoreFactory

func GSMStoreFactory(ctx context.Context) (models.Store, error)

Types

type GSMClient

type GSMClient interface {
	GetSecret(ctx context.Context, req *secretmanagerpb.GetSecretRequest, opts ...gax.CallOption) (*secretmanagerpb.Secret, error)       //nolint:lll
	CreateSecret(ctx context.Context, req *secretmanagerpb.CreateSecretRequest, opts ...gax.CallOption) (*secretmanagerpb.Secret, error) //nolint:lll
	DeleteSecret(ctx context.Context, req *secretmanagerpb.DeleteSecretRequest, opts ...gax.CallOption) error

	AccessSecretVersion(ctx context.Context, req *secretmanagerpb.AccessSecretVersionRequest, opts ...gax.CallOption) (*secretmanagerpb.AccessSecretVersionResponse, error) //nolint:lll
	AddSecretVersion(ctx context.Context, req *secretmanagerpb.AddSecretVersionRequest, opts ...gax.CallOption) (*secretmanagerpb.SecretVersion, error)                     //nolint:lll
	DestroySecretVersion(ctx context.Context, req *secretmanagerpb.DestroySecretVersionRequest, opts ...gax.CallOption) (*secretmanagerpb.SecretVersion, error)             //nolint:lll

	Close() error
}

func NewGSMClient

func NewGSMClient(ctx context.Context) (GSMClient, error)

type GSMStore

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

GSMStore provides methods for accessing secrets stored in Google Secret Manager.

func NewGSMStore

func NewGSMStore(client GSMClient) *GSMStore

NewGSMStore returns a new GSMStore.

func (*GSMStore) Close

func (s *GSMStore) Close() error

func (*GSMStore) Delete

func (s *GSMStore) Delete(ctx context.Context, value models.Value) error

Delete destroys the secret at the given URL.

func (*GSMStore) Get

func (s *GSMStore) Get(ctx context.Context, value models.Value) (string, error)

Get returns the plaintext value for the secret at the given URL.

func (*GSMStore) Set

func (s *GSMStore) Set(ctx context.Context, value models.Value, updated string) error

Set updates the plaintext value for the secret at the given URL.

Jump to

Keyboard shortcuts

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