Files
aws-server-sdk/secret.go
T
shiran 3d4c2dbb20
test / go (push) Successful in 1m7s
feat: initial AWS Server Go SDK
2026-08-22 22:14:08 +08:00

15 lines
571 B
Go

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) }