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.

20 lines
1021 B

  1. package Models
  2. import (
  3. "time"
  4. "github.com/gofrs/uuid"
  5. )
  6. // 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. UserUsername string ` json:"user_username"`
  12. FriendID string `gorm:"not null" json:"friend_id"` // Stored encrypted
  13. FriendUsername string ` json:"friend_username"`
  14. FriendPublicAsymmetricKey string ` json:"asymmetric_public_key"`
  15. SymmetricKey string `gorm:"not null" json:"symmetric_key"` // Stored encrypted
  16. AcceptedAt time.Time ` json:"accepted_at"`
  17. }