Documentation ¶
Overview ¶
Package gensupport is an internal implementation detail used by code generated by the google-api-go-generator tool.
This package may be modified at any time without regard for backwards compatibility. It should not be used directly by API users.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectMediaType ¶
DetectMediaType detects and returns the content type of the provided media. If the type can not be determined, "application/octet-stream" is returned.
func IncludeMedia ¶
IncludeMedia combines an existing HTTP body with media content to create a multipart/related HTTP body.
bodyp is an in/out parameter. It should initially point to the reader of the application/json (or whatever) payload to send in the API request. It's updated to point to the multipart body reader.
ctypep is an in/out parameter. It should initially point to the content type of the bodyp, usually "application/json". It's updated to the "multipart/related" content type, with random boundary.
The return value is a function that can be used to close the bodyp Reader with an error.
func MarshalJSON ¶
MarshalJSON returns a JSON encoding of schema containing only selected fields. A field is selected if:
- it has a non-empty value, or
- its field name is present in forceSendFields, and
- it is not a nil pointer or nil interface.
The JSON key for each selected field is taken from the field's json: struct tag.
Types ¶
type ContentSniffer ¶
type ContentSniffer struct {
// contains filtered or unexported fields
}
ContentSniffer wraps a Reader, and reports the content type determined by sniffing up to 512 bytes from the Reader.
func NewContentSniffer ¶
func NewContentSniffer(r io.Reader) *ContentSniffer
func (*ContentSniffer) ContentType ¶
func (sct *ContentSniffer) ContentType() (string, bool)
ContentType returns the sniffed content type, and whether the content type was succesfully sniffed.
type URLParams ¶
URLParams is a simplified replacement for url.Values that safely builds up URL parameters for encoding.
func (URLParams) Encode ¶
Encode encodes the values into “URL encoded” form ("bar=baz&foo=quux") sorted by key.