secrets

package
v0.0.0-...-d6cb553 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NO_DATA = string('\u0000')
)
View Source
const OAUTH_CLIENT_ID = "OAUTH_CLIENT_ID"
View Source
const OAUTH_CLIENT_SECRET = "OAUTH_CLIENT_SECRET"

Variables

View Source
var ValueOutOfRange = errorx.RegisterTrait("value out of range")

Functions

func AddSecretVersion

func AddSecretVersion(ctx context.Context, name string, value []byte) (*secretmanagerpb.SecretVersion, error)

AddSecretVersion adds a new secret version to the given secret with the provided payload.

func CreateSecret

func CreateSecret(ctx context.Context, id string) (*secretmanagerpb.Secret, error)

func CreateSecretWithValue

func CreateSecretWithValue(ctx context.Context, name string, value []byte) error

func DestroyAllButLatestVersion

func DestroyAllButLatestVersion(ctx context.Context, name string) error

func DestroyAllPreviousVersions

func DestroyAllPreviousVersions(ctx context.Context, name string, version int) error

func DestroySecretVersion

func DestroySecretVersion(ctx context.Context, name string, version int) error

func DisableSecretVersion

func DisableSecretVersion(ctx context.Context, name string, version int) error

func EnableSecretVersion

func EnableSecretVersion(ctx context.Context, name string, version int) error

func GetSecretValue

func GetSecretValue(ctx context.Context, name string) ([]byte, error)

GetSecretValue accesses the payload for the given secret version if one exists. The version can be a version number as a string (e.g. "5") or an alias (e.g. "latest").

func GetSecretValueAsString

func GetSecretValueAsString(ctx context.Context, name string) string

func MustGetSecretValue

func MustGetSecretValue(ctx context.Context, name string, f func(ctx context.Context, name string) ([]byte, error)) []byte

func RemoveSecret

func RemoveSecret(ctx context.Context, name string) error

func ReplaceSecretWithNewVersion

func ReplaceSecretWithNewVersion(ctx context.Context, name string, value []byte) error

func UpdateSecretWithNewVersion

func UpdateSecretWithNewVersion(ctx context.Context, name string, value []byte) error

Types

type NewPathVersionOption

type NewPathVersionOption func(path *Path)

func WithLatestVersion

func WithLatestVersion() NewPathVersionOption

func WithVersion

func WithVersion(version int) NewPathVersionOption

func WithoutVersion

func WithoutVersion() NewPathVersionOption

type Path

type Path struct {
	ProjectNumber int
	Name          string
	Version       int
}

func NewPath

func NewPath(name string, version NewPathVersionOption) Path

func (Path) LatestVersion

func (p Path) LatestVersion() string

func (Path) String

func (p Path) String() string

func (Path) WithVersion

func (p Path) WithVersion() string

func (Path) WithoutVersion

func (p Path) WithoutVersion() string

Jump to

Keyboard shortcuts

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