June 2017
Beginner
1091 pages
22h 9m
English
Another service we are going to make use of is the Google App Engine Users API, which provides the authentication of Google accounts (and Google Apps accounts).
Create a new file called users.go and add the following code:
type User struct {
Key *datastore.Key `json:"id" datastore:"-"`
UserID string `json:"-"`
DisplayName string `json:"display_name"`
AvatarURL string `json:"avatar_url"`
Score int `json:"score"`
}
Similar to the Question struct, we have Key and a few fields that make up the User entity. This struct represents an object that belongs to our application that describes a user; we will have one for every authenticated user in our system, but this isn't the same user object that we'll get from the Users API.
Importing ...
Read now
Unlock full access