...
1 package runtime
2
3 import (
4 "google.golang.org/genproto/googleapis/api/httpbody"
5 )
6
7
8
9
10
11 type HTTPBodyMarshaler struct {
12 Marshaler
13 }
14
15
16
17
18 func (h *HTTPBodyMarshaler) ContentType(v interface{}) string {
19 if httpBody, ok := v.(*httpbody.HttpBody); ok {
20 return httpBody.GetContentType()
21 }
22 return h.Marshaler.ContentType(v)
23 }
24
25
26
27 func (h *HTTPBodyMarshaler) Marshal(v interface{}) ([]byte, error) {
28 if httpBody, ok := v.(*httpbody.HttpBody); ok {
29 return httpBody.GetData(), nil
30 }
31 return h.Marshaler.Marshal(v)
32 }
33
View as plain text