MCPcopy Create free account
hub / github.com/prometheus/common / MarshalJSON

Method MarshalJSON

config/http_config.go:114–121  ·  view source on GitHub ↗

MarshalJSON implements the json.Marshaler interface for TLSVersion.

()

Source from the content-addressed store, hash-verified

112
113// MarshalJSON implements the json.Marshaler interface for TLSVersion.
114func (tv TLSVersion) MarshalJSON() ([]byte, error) {
115 for s, v := range TLSVersions {
116 if tv == v {
117 return json.Marshal(s)
118 }
119 }
120 return nil, fmt.Errorf("unknown TLS version: %d", tv)
121}
122
123// String implements the fmt.Stringer interface for TLSVersion.
124func (tv *TLSVersion) String() string {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected