@@ -0,0 +1,14 @@
|
||||
package awsserversdk
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// Secret redacts credentials when formatted or marshaled. Reveal must be called explicitly.
|
||||
type Secret struct{ value string }
|
||||
|
||||
func (s Secret) Reveal() string { return s.value }
|
||||
func (Secret) String() string { return "[REDACTED]" }
|
||||
func (Secret) GoString() string { return "[REDACTED]" }
|
||||
func (Secret) MarshalJSON() ([]byte, error) { return json.Marshal("[REDACTED]") }
|
||||
func (s *Secret) UnmarshalJSON(raw []byte) error { return json.Unmarshal(raw, &s.value) }
|
||||
Reference in New Issue
Block a user