Skip to content

Instantly share code, notes, and snippets.

@jbowles jbowles/mstatus.go
Last active Dec 29, 2015

Embed
What would you like to do?
gobike MStatus struct using with megajson experiment
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
You can’t perform that action at this time.