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.

24 lines
757 B

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