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.

19 lines
1.0 KiB

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