12345678910111213141516171819202122 |
- package main
- import (
- "time"
- )
- type User struct {
- Model
- Handle string // Handle/Nickname for User
- Name string // Can be in any format (including left blank!)
- PrimKey string // User's Public SSH Key
- Email string // User's Email Address (Used for account recovery, and push notifications)
- }
- func (u *User) LastOn() time.Duration {
- return time.Since(u.UpdatedAt).Round(time.Second)
- }
- func (u *User) Joined() time.Duration {
- return time.Since(u.CreatedAt).Round(time.Second)
- }
|