|
|
- package Models
-
- import (
- "database/sql"
- "time"
-
- "github.com/gofrs/uuid"
- )
-
- // MessageData holds the content of the message
- // encrypted through the Message.SymmetricKey
- type MessageData struct {
- Base
- Data string `gorm:"not null" json:"data"` // Stored encrypted
- SenderID string `gorm:"not null" json:"sender_id"` // Stored encrypted
- SymmetricKey string `gorm:"not null" json:"symmetric_key"` // Stored encrypted
- }
-
- // Message holds data pertaining to each users' message
- type Message struct {
- Base
- MessageDataID uuid.UUID ` json:"message_data_id"`
- MessageData MessageData ` json:"message_data"`
- SymmetricKey string `gorm:"not null" json:"symmetric_key"` // Stored encrypted
- AssociationKey string `gorm:"not null" json:"association_key"` // Stored encrypted
- Expiry sql.NullTime ` json:"expiry"`
- CreatedAt time.Time `gorm:"not null" json:"created_at"`
- }
|