models

package
v0.0.0-...-78ea3c1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func InitDB

func InitDB(cfg Config)

Types

type Claims

type Claims struct {
	Role string `json:"role"`
	jwt.StandardClaims
}

It will include the standard claims defined by the JWT specification, as well as a field for the user's role within the application.

type Config

type Config struct {
	Host     string
	Port     string
	User     string
	Password string
	DBName   string
	SSLMode  string
}

type Game

type Game struct {
	gorm.Model
	Id        int    `gorm:"unique" json:"id"`
	Date      string ` json:"date"`
	Status    string `json:"status"`
	Timestamp int    `json:"timestamp"`
	HomeTeam  string `json:"homeTeam"`
	AwayTeam  string `json:"awayTeam"`
	HomeGoals int    `json:"homeGoals"`
	AwayGoals int    `json:"awayGoals"`
}

type Ticket

type Ticket struct {
	gorm.Model
	UserId        uint
	GameId        uint
	Seat          string
	Price         float32
	BookingStatus string
}

type User

type User struct {
	gorm.Model
	Name     string `json:"name"`
	Email    string `gorm:"unique" json:"email"`
	Password string `json:"password"`
	Role     string `json:"role"`
}

Jump to

Keyboard shortcuts

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