MCPcopy
hub / github.com/grpc-ecosystem/grpc-gateway / add

Method add

runtime/marshaler_registry.go:75–83  ·  view source on GitHub ↗

add adds a marshaler for a case-sensitive MIME type string ("*" to match any MIME type).

(mime string, marshaler Marshaler)

Source from the content-addressed store, hash-verified

73// add adds a marshaler for a case-sensitive MIME type string ("*" to match any
74// MIME type).
75func (m marshalerRegistry) add(mime string, marshaler Marshaler) error {
76 if len(mime) == 0 {
77 return errors.New("empty MIME type")
78 }
79
80 m.mimeMap[mime] = marshaler
81
82 return nil
83}
84
85// makeMarshalerMIMERegistry returns a new registry of marshalers.
86// It allows for a mapping of case-sensitive Content-Type MIME type string to runtime.Marshaler interfaces.

Callers 1

WithMarshalerOptionFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected