Encrypted messaging app
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
260 B

  1. package Models
  2. import (
  3. "time"
  4. "github.com/gofrs/uuid"
  5. )
  6. func (s Session) IsExpired() bool {
  7. return s.Expiry.Before(time.Now())
  8. }
  9. type Session struct {
  10. Base
  11. UserID uuid.UUID `gorm:"type:uuid;column:user_id;not null;"`
  12. User User
  13. Expiry time.Time
  14. }