-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathuser.go
More file actions
31 lines (26 loc) · 717 Bytes
/
user.go
File metadata and controls
31 lines (26 loc) · 717 Bytes
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
package tork
import "time"
type UsernameKey string
const (
USER_GUEST string = "guest"
USERNAME UsernameKey = "username"
)
type User struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Username string `json:"username,omitempty"`
PasswordHash string `json:"-"`
Password string `json:"password,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
Disabled bool `json:"disabled,omitempty"`
}
func (u *User) Clone() *User {
return &User{
ID: u.ID,
Name: u.Name,
Username: u.Username,
PasswordHash: u.PasswordHash,
CreatedAt: u.CreatedAt,
Disabled: u.Disabled,
}
}