Source File
marshal_httpbodyproto.go
Belonging Package
github.com/grpc-ecosystem/grpc-gateway/v2/runtime
package runtimeimport ()// HTTPBodyMarshaler is a Marshaler which supports marshaling of a// google.api.HttpBody message as the full response body if it is// the actual message used as the response. If not, then this will// simply fallback to the Marshaler specified as its default Marshaler.type HTTPBodyMarshaler struct {Marshaler}// ContentType returns its specified content type in case v is a// google.api.HttpBody message, otherwise it will fall back to the default Marshalers// content type.func ( *HTTPBodyMarshaler) ( interface{}) string {if , := .(*httpbody.HttpBody); {return .GetContentType()}return .Marshaler.ContentType()}// Marshal marshals "v" by returning the body bytes if v is a// google.api.HttpBody message, otherwise it falls back to the default Marshaler.func ( *HTTPBodyMarshaler) ( interface{}) ([]byte, error) {if , := .(*httpbody.HttpBody); {return .GetData(), nil}return .Marshaler.Marshal()}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |