Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindByGoogleID ¶
FindByGoogleID returns a user from the database by user's google ID.
func PersistUser ¶
PersistUser adds a new user to the database.
func RegisterContainer ¶
func RegisterContainer(container *restful.Container, r *Resource)
RegisterContainer Defines user endpoints
Types ¶
type Resource ¶
type Resource struct { *api.DB *api.TokenValidator }
Resource for user handler methods.
type User ¶
type User struct { ID int64 `db:"id" json:"-"` GoogleID string `db:"google_id" json:"-"` GoogleHash string `db:"google_fields_hash" json:"-"` Name string `db:"full_name"` Email string `db:"email"` ShowPicture bool `db:"show_picture"` Picture string `db:"picture"` Alias string `db:"alias"` Locale string `db:"locale"` Country string `db:"country"` }
User User struct with db and json tags.
func Authenticate ¶
Authenticate checks a user's bearer token and returns a User. User is also persisted or updated in the database.
Click to show internal directories.
Click to hide internal directories.