models

package
v0.0.0-...-c75624c Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT 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 `gorm:"uniqueIndex"`
	Description string
	Value       int
	Flag        string
}

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 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"`
	Comments   string `gorm:"default:''"`
}

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
	Username string `gorm:"uniqueIndex"`
	Content  string
}

Jump to

Keyboard shortcuts

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