MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / String

Method String

pkg/settings/masked.go:30–47  ·  view source on GitHub ↗

String hides the underlying value.

(sv *Values)

Source from the content-addressed store, hash-verified

28
29// String hides the underlying value.
30func (s *MaskedSetting) String(sv *Values) string {
31 // Special case for non-reportable/sensitive strings: we still want
32 // to distinguish empty from non-empty (= customized).
33 if st, ok := s.setting.(*StringSetting); ok && st.String(sv) == "" {
34 return ""
35 }
36 isSensitive := false
37 if st, ok := s.setting.(internalSetting); ok {
38 isSensitive = st.isSensitive()
39 }
40 sensitiveRedactionEnabled := redactSensitiveSettingsEnabled.Get(sv)
41 // Non-reportable settings are always redacted. Sensitive settings are
42 // redacted if the redaction cluster setting is enabled.
43 if !isSensitive || sensitiveRedactionEnabled {
44 return "<redacted>"
45 }
46 return s.setting.String(sv)
47}
48
49// DefaultString returns the default value for the setting as a string.
50func (s *MaskedSetting) DefaultString() string {

Callers

nothing calls this directly

Calls 3

StringMethod · 0.65
isSensitiveMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected