models

package
v0.0.0-...-0a0123b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Challenge

type Challenge struct {
	gorm.Model
	Name          string
	Description   string
	Value         int
	Flag          string
	CompetitionID uint
	Competition   Competition `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}

type Comment

type Comment struct {
	gorm.Model
	Id        uint32 `gorm:"uniqueIndex;autoIncrement"`
	Username  string
	CommentId uint32
	Content   string
	Quote     string
}

type Competition

type Competition struct {
	gorm.Model
	Name       string
	Graph      string
	Active     bool
	Challenges []Challenge
}

type Evidence

type Evidence struct {
	gorm.Model
	Name        string
	ChallengeID *int      `gorm:""`
	Challenge   Challenge `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
	UserID      int       `gorm:""`
	User        User
	PositionX   int  `gorm:"default:0"`
	PositionY   int  `gorm:"default:0"`
	IsFlag      bool `gorm:"default:false"`
}

type EvidenceConnection

type EvidenceConnection struct {
	gorm.Model
	SourceID      int      `gorm:"index:evidence_connection_idx"`
	Source        Evidence `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
	DestinationID int      `gorm:"index:evidence_connection_idx"`
	Destination   Evidence `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
	UserID        int      `gorm:"index:evidence_connection_idx"`
	User          User     `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
}

type EvidenceReport

type EvidenceReport struct {
	gorm.Model
	UserID int  `gorm:"uniqueIndex"`
	User   User `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
	URL    string
}

type HighlightArea

type HighlightArea struct {
	gorm.Model
	Id        uint32 `gorm:"uniqueIndex;autoIncrement"`
	Username  string
	CommentId uint32
	Height    float32
	Width     float32
	PageIndex uint32
	Top       float32
	Left      float32
}

type HomePage

type HomePage struct {
	gorm.Model
	Id      string `gorm:"uniqueIndex"`
	Content string
}

type Page

type Page struct {
	gorm.Model
	Route   string `gorm:"uniqueIndex"`
	Title   string
	Content string
}

type User

type User struct {
	gorm.Model
	Username         string `gorm:"unique"`
	Email            string `gorm:"unique"`
	Password         string
	Type             string `gorm:"default:user"`
	HasWriteup       bool   `gorm:"default:false"`
	Grade            int    `gorm:"default:0"`
	ComputerID       string
	ComputerPassword string
}

func (*User) CheckPassword

func (user *User) CheckPassword(providedPassword string) error

func (*User) HashPassword

func (user *User) HashPassword(password string) error

type Writeup

type Writeup struct {
	gorm.Model
	UserID  uint `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	User    User
	Content string
	Type    string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL