Last active
March 11, 2017 23:12
-
-
Save harlow/6b597eb07bb6ad4b766037a8527b8483 to your computer and use it in GitHub Desktop.
Struct w/ return vals from Aboutme API
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
// if "name" is returned as `[]` in JSON payload the json.Unmarshal func will panic in Golang | |
// Name struct { | |
// GivenName string `json:"givenName"` | |
// FamilyName string `json:"familyName"` | |
// Formatted string `json:"formatted"` | |
// } `json:"name"` | |
type Profile struct { | |
ID string `json:"id"` | |
Hash string `json:"hash"` | |
RequestHash string `json:"requestHash"` | |
ProfileURL string `json:"profileUrl"` | |
PreferredUsername string `json:"preferredUsername"` | |
ThumbnailURL string `json:"thumbnailUrl"` | |
DefaultAvatar bool `json:"defaultAvatar"` | |
Photos []struct { | |
Value string `json:"value"` | |
Type string `json:"type"` | |
} `json:"photos"` | |
Name struct { | |
GivenName string `json:"givenName"` | |
FamilyName string `json:"familyName"` | |
Formatted string `json:"formatted"` | |
} `json:"name"` | |
DisplayName string `json:"displayName"` | |
CurrentLocation string `json:"currentLocation"` | |
Accounts []struct { | |
Domain string `json:"domain"` | |
Display string `json:"display"` | |
URL string `json:"url"` | |
Username string `json:"username"` | |
Verified string `json:"verified"` | |
Shortname string `json:"shortname"` | |
} `json:"accounts"` | |
Urls []struct { | |
Value string `json:"value"` | |
Title string `json:"title"` | |
} `json:"urls"` | |
} |
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
{ | |
"entry": [{ | |
"id": "24093338", | |
"hash": "f5a714266c7ea5ea163cddc8d30bc53e", | |
"requestHash": "569fd44396d10a2f3aefb7b868e5e322", | |
"profileUrl": "http:\/\/gravatar.com\/oniiru", | |
"preferredUsername": "oniiru", | |
"thumbnailUrl": "https:\/\/secure.gravatar.com\/avatar\/f5a714266c7ea5ea163cddc8d30bc53e", | |
"photos": [{ | |
"value": "https:\/\/secure.gravatar.com\/avatar\/f5a714266c7ea5ea163cddc8d30bc53e", | |
"type": "thumbnail" | |
}], | |
"name": [], | |
"displayName": "oniiru", | |
"urls": [] | |
}] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment