user.go 492 B

12345678910111213141516171819202122
  1. package main
  2. import (
  3. "time"
  4. )
  5. type User struct {
  6. Model
  7. Handle string // Handle/Nickname for User
  8. Name string // Can be in any format (including left blank!)
  9. PrimKey string // User's Public SSH Key
  10. Email string // User's Email Address (Used for account recovery, and push notifications)
  11. }
  12. func (u *User) LastOn() time.Duration {
  13. return time.Since(u.UpdatedAt).Round(time.Second)
  14. }
  15. func (u *User) Joined() time.Duration {
  16. return time.Since(u.CreatedAt).Round(time.Second)
  17. }