Help us shape the future of Go! Take the 2026 Go Developer Survey

secret

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Masked = "***"

	MinMaskedLength = 8
)
View Source
const EnvPrefix = "OPERION_SECRET_"

Variables

This section is empty.

Functions

func FromEnviron

func FromEnviron(environ []string) map[string]string

FromEnviron returns the secrets among environ, the KEY=value pairs os.Environ gives: OPERION_SECRET_CRM_TOKEN becomes crm_token.

Types

type Mask

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

Mask replaces secret values of at least MinMaskedLength characters with Masked.

func NewMask

func NewMask(values map[string]string) *Mask

NewMask returns nil when no value is long enough to mask; a nil Mask leaves everything as it is.

func (*Mask) Data

func (m *Mask) Data(data map[string]any) map[string]any

Data masks every secret value in the strings of data, through nested maps and lists.

func (*Mask) Text

func (m *Mask) Text(s string) string

Text masks every secret value in s.

Jump to

Keyboard shortcuts

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