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

Method MarshalJSON

config/http_config.go:218–223  ·  view source on GitHub ↗

MarshalJSON implements the json.Marshaler interface for URL.

()

Source from the content-addressed store, hash-verified

216
217// MarshalJSON implements the json.Marshaler interface for URL.
218func (u URL) MarshalJSON() ([]byte, error) {
219 if u.URL != nil {
220 return json.Marshal(u.URL.String())
221 }
222 return []byte("null"), nil
223}
224
225// OAuth2 is the oauth2 client configuration.
226type OAuth2 struct {

Callers

nothing calls this directly

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected