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.

15 lines
447 B

  1. package Models
  2. import "github.com/gofrs/uuid"
  3. type MessageData struct {
  4. Base
  5. Data []byte `gorm:"not null" json:"data"` // Stored encrypted
  6. }
  7. type MessageKey struct {
  8. Base
  9. UserID uuid.UUID `gorm:"type:uuid;column:user_id;not null;" json:"user_id"`
  10. MessageDataID uuid.UUID `gorm:"type:uuid;column:message_data_id;not null;" json:"message_data_id"`
  11. SymmetricKey []byte `gorm:"not null" json:"symmetric_key"` // Stored encrypted
  12. }