Documentation ¶
Index ¶
Constants ¶
const CensoredText = "###CENSORED###"
CensoredText is the text displayed instead of protected values when they are masked.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MaskedString ¶
type MaskedString string
MaskedString protects a string value by masking it when it printed or marshalled to JSON, YAML or Text. The protected value can be revealed by calling the RevealString() method on the MaskedString value.
func (MaskedString) GoString ¶
func (s MaskedString) GoString() string
GoString returns the Go syntax for a MaskedString value, which will invariably be the Go syntax for the CensoredString constant.
func (MaskedString) MarshalText ¶
func (s MaskedString) MarshalText() ([]byte, error)
MarshalText marshals the MaskedString value into a textual form, which will invariably be the value of the CensoredString constant.
func (MaskedString) RevealString ¶
func (s MaskedString) RevealString() string
RevealString returns the underlying protected string of a MaskedString value.
func (MaskedString) String ¶
func (s MaskedString) String() string
String returns the native format for a MaskedString value, which will invariably be the CensoredString constant.
type StringRevealer ¶
type StringRevealer interface {
RevealString() string
}
StringRevealer is an interface that provides a method for revealing protected values.