Last active
December 29, 2015 18:59
-
-
Save jbowles/7714619 to your computer and use it in GitHub Desktop.
gobike MStatus struct using with megajson experiment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gobike | |
/* | |
Example JSON: | |
{ | |
"HTTPStatus":200, | |
"TimeLocal":"2013-11-29T18:43:59.674946633-07:00", | |
"TimeUTC":"2013-11-30T01:43:59.674946695Z", | |
"URL":{ | |
"Scheme":"", | |
"Opaque":"", | |
"User":null, | |
"Host":"", | |
"Path":"/", | |
"RawQuery":"", | |
"Fragment":"" | |
}, | |
"CacheTimeoutVal":1000000000, | |
"MemcacheError":null | |
} | |
NOTE: If I get rid of the 'URL' and 'MemcacheError' fields, AND change my memcache API to NOT RETURN THE FIELDS then all thigs work | |
by simply passing the http response body to the decoder. | |
*/ | |
type MStatus struct { | |
HTTPStatus int | |
TimeLocal string | |
TimeUTC string | |
URL *URL_info | |
CacheTimeoutVal int | |
} | |
type URL_info struct { | |
Scheme string | |
Opaque string | |
Host string | |
Path string | |
RawQuery string | |
Fragment string | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment