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

Function makeMarshalerMIMERegistry

runtime/marshaler_registry.go:93–99  ·  view source on GitHub ↗

makeMarshalerMIMERegistry returns a new registry of marshalers. It allows for a mapping of case-sensitive Content-Type MIME type string to runtime.Marshaler interfaces. For example, you could allow the client to specify the use of the runtime.JSONPb marshaler with an "application/jsonpb" Content-Ty

()

Source from the content-addressed store, hash-verified

91// "*" can be used to match any Content-Type.
92// This can be attached to a ServerMux with the marshaler option.
93func makeMarshalerMIMERegistry() marshalerRegistry {
94 return marshalerRegistry{
95 mimeMap: map[string]Marshaler{
96 MIMEWildcard: defaultMarshaler,
97 },
98 }
99}
100
101// WithMarshalerOption returns a ServeMuxOption which associates inbound and outbound
102// Marshalers to a MIME type in mux.

Callers 1

NewServeMuxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected