/
user.go
39 lines (35 loc) · 1.1 KB
/
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
35
36
37
38
39
package user
import (
"time"
)
// UserInfo is sent out as a response
type UserInfo struct {
ID string `json:"id"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Email string `json:"email"`
Password string `json:"-"`
HashedPassword string `json:"-"`
Activated bool `json:"-"`
CreatedAt *time.Time `json:"-"`
UpdatedAt *time.Time `json:"-"`
Token string `json:"token"`
}
// UserRegistrationInfo stores request
// data for registering a new user
type UserRegistrationInfo struct {
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Email string `json:"email"`
Password string `json:"password"`
HashedPassword string `json:"-"`
Activated bool `json:"activated"`
CreatedAt *time.Time `json:"createdAt"`
UpdatedAt *time.Time `json:"updatedAt"`
}
// UserLoginInfo stores request data
// for logging in a user
type UserLoginInfo struct {
Email string `json:"email"`
Password string `json:"password"`
}