secrets

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: AGPL-3.0 Imports: 1 Imported by: ? 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

Overview

Package secrets provides a secret retrieval interface with implementations for environment variables, GCP Secret Manager, and AWS SSM Parameter Store.

Example (EnvSecretSource)
package main

import (
	"context"
	"fmt"
	"os"

	"github.com/primandproper/platform-go/secrets/env"
)

func main() {
	os.Setenv("EXAMPLE_SECRET", "s3cret")
	defer os.Unsetenv("EXAMPLE_SECRET")

	source, err := env.NewEnvSecretSource(nil, nil, nil)
	if err != nil {
		panic(err)
	}
	defer source.Close()

	secret, err := source.GetSecret(context.Background(), "EXAMPLE_SECRET")
	if err != nil {
		panic(err)
	}

	fmt.Println(secret)
}
Output:
s3cret

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SecretSource

type SecretSource interface {
	GetSecret(ctx context.Context, name string) (string, error)
	Close() error
}

SecretSource provides access to secrets.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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