Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Config = SecretStringConfig{ Marshallable: false, Mode: FilterModeFixedString, FixedDummyString: "[FILTERED]", }
Config is the instance of SecretStringConfig. It's used by all SecretString instances.
Functions ¶
This section is empty.
Types ¶
type FilterMode ¶
type FilterMode int
FilterMode is a configuration of SecretString. See FilterModeHide, FilterModeFixedString, FilterModeDisable
const ( // FilterModeFixedString : Format SecretString to a fixed string. // ex) "foobar"-> "[FILTERED]" FilterModeFixedString FilterMode = iota // FilterModeHide : Format SecretString to asterisk. // ex) "foobar" -> "******" FilterModeHide // FilterModeDisable : Format SecretString to original string. This flag should not use on release build. // ex) "foobar"-> "foobar" FilterModeDisable )
type SecretString ¶
type SecretString string
SecretString is an alias for string. This type cannot format by normal ways.
func (SecretString) GoString ¶
func (ss SecretString) GoString() string
GoString : Implementation of GoStringer interface.
func (SecretString) MarshalJSON ¶
func (ss SecretString) MarshalJSON() ([]byte, error)
MarshalJSON overrides the result of json.Marshal(). If Config.Marshallable = true, the result JSON contains raw strings.
func (SecretString) MarshalXML ¶
func (ss SecretString) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML overrides the result of xml.Marshal(). If Config.Marshallable = true, the result XML contains raw strings.
func (SecretString) RawString ¶
func (ss SecretString) RawString() string
RawString is convert SecretString to basic string. Returned string is not safe for formatting, so be careful to use it.
func (SecretString) String ¶
func (ss SecretString) String() string
String : Implementation of Stringer interface.
type SecretStringConfig ¶
type SecretStringConfig struct { // If true, The members of structs can marshal by json.Marshal() or xml.Marshal(). // Default value: false Marshallable bool // See FilterModeHide, FilterModeFixedString, FilterModeDisable // Default value: FilterModeFixedString Mode FilterMode // if Mode == FilterModeFixedString, this string is used for formatting. // Default value: "[FILTERED]" FixedDummyString string }
SecretStringConfig is configurations of SecretString