-
Notifications
You must be signed in to change notification settings - Fork 3
/
user.go
34 lines (27 loc) · 1001 Bytes
/
user.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package model
import (
"net/mail"
"google.golang.org/appengine/datastore"
)
//go:generate generator -c "Profile"
// User is anybody interacting with our systems. It will
// ultimately refer to who accessed Coduno (or on whose
// behalf).
type User struct {
// Encapsulates Name (combined first and last name,
// however the user likes) and an e-mail address.
//
// Datastore will split this into two properties
// called Name and Address, where Address must be
// guaranteed to be unique.
mail.Address `datastore:",index",json:",omitempty"`
// Unique name for this user, like analogous to @flowlo
// on GitHub/Twitter/...
Nick string `datastore:",index",json:",omitempty"`
// Points to the company a user works for, if any.
Company *datastore.Key `datastore:",index",json:",omitempty"`
// Hashed and salted password to be accessed by
// corresponding helpers in util.
// See https://godoc.org/golang.org/x/crypto/bcrypt
HashedPassword []byte `datastore:",noindex" json:"-"`
}