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

Method MarshalJSON

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

MarshalJSON implements the json.Marshaler interface for TLSVersion.

()

Source from the content-addressed store, hash-verified

105
106// MarshalJSON implements the json.Marshaler interface for TLSVersion.
107func (tv TLSVersion) MarshalJSON() ([]byte, error) {
108 for s, v := range TLSVersions {
109 if tv == v {
110 return json.Marshal(s)
111 }
112 }
113 return nil, fmt.Errorf("unknown TLS version: %d", tv)
114}
115
116// String implements the fmt.Stringer interface for TLSVersion.
117func (tv *TLSVersion) String() string {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected