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

package Models
import (
"time"
"github.com/gofrs/uuid"
)
// TODO: Add profile picture
type Friend struct {
Base
Username string `gorm:"not null" json:"username"` // Stored encrypted
AsymmetricPublicKey string `gorm:"not null" json:"asymmetric_public_key"` // Stored encrypted
}
// Set with Friend being the requestee, and RequestFromID being the requester
type FriendRequest struct {
Base
UserID uuid.UUID `gorm:"type:uuid;column:user_id;not null;" json:"user_id"`
User User `json:"user"`
FriendID string `gorm:"not null" json:"friend_id"` // Stored encrypted
SymmetricKey string `gorm:"not null" json:"symmetric_key"` // Stored encrypted
AcceptedAt time.Time `json:"accepted_at"`
}