models

package
v0.0.0-...-d0d7a61 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: MIT Imports: 4 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 {
	ID        uuid.UUID `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Name      string    `json:"Name" binding:"required"`
	Category  string    `json:"Category" binding:"required"`
	Solves    int       `json:"Solves" binding:"required"`
	Points    int       `json:"Points" binding:"required"`
	Author    string    `json:"Author" binding:"required"`
	RawText   string    `json:"RawText" binding:"required"`
	Flag      string    `json:"Flag" binding:"required"`
}

Challenge "Object

func (*Challenge) BeforeCreate

func (challenge *Challenge) BeforeCreate(scope *gorm.Scope) error

BeforeCreate ...

func (*Challenge) BeforeUpdate

func (challenge *Challenge) BeforeUpdate(scope *gorm.Scope) error

BeforeUpdate ...

type User

type User struct {
	ID        uuid.UUID `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	UserName  string    `json:"user_name" binding:"required"`
	Password  string    `json:"password" binding:"required"`
	Email     string    `json:"email" binding:"required"`
	Score     int       `json:"score" binding:"required"`
	Solves    string    `json:"solves" binding:"required"`
	Elevated  bool      `json:"elevated" binding:"required" gorm:"default:'false'"`
}

User "Object

func (*User) BeforeCreate

func (user *User) BeforeCreate(scope *gorm.Scope) error

BeforeCreate ...

func (*User) BeforeUpdate

func (user *User) BeforeUpdate(scope *gorm.Scope) error

BeforeUpdate ...

func (*User) HasntSolved

func (user *User) HasntSolved(id uuid.UUID) bool

HasntSolved ...

Jump to

Keyboard shortcuts

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