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.

22 lines
1.2 KiB

  1. package Models
  2. import (
  3. "database/sql"
  4. "time"
  5. "github.com/gofrs/uuid"
  6. )
  7. // FriendRequest Set with Friend being the requestee, and RequestFromID being the requester
  8. type FriendRequest struct {
  9. Base
  10. UserID uuid.UUID `gorm:"type:uuid;column:user_id;not null;" json:"user_id"`
  11. User User ` json:"user"`
  12. FriendID string `gorm:"not null" json:"friend_id"` // Stored encrypted
  13. FriendUsername string ` json:"friend_username"` // Stored encrypted
  14. FriendImagePath string ` json:"friend_image_path"`
  15. FriendPublicAsymmetricKey string ` json:"asymmetric_public_key"` // Stored encrypted
  16. SymmetricKey string `gorm:"not null" json:"symmetric_key"` // Stored encrypted
  17. AcceptedAt sql.NullTime ` json:"accepted_at"`
  18. CreatedAt time.Time `gorm:"not null" json:"created_at"`
  19. }