secret

package
v0.0.0-...-57e4d6e Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package secret provides a custom string type that hides sensitive data from output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type String

type String string

String represents a string holding sensitive data.

func (String) MarshalJSON

func (s String) MarshalJSON() ([]byte, error)

MarshalJSON ensures the sensitive string is redacted in JSON.

func (String) SecretValue

func (s String) SecretValue() string

SecretValue returns the secret value.

func (String) String

func (s String) String() string

String implements the fmt.Stringer interface to prevent sensitive data from being printed.

func (*String) UnmarshalJSON

func (s *String) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals a secret value from JSON.

Jump to

Keyboard shortcuts

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