models

package
v0.0.0-...-ea17c9a Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAccount

func AddAccount(userId, name, loginType, country, email, picture string) error

func AddTeam

func AddTeam(teamName, managerName, formation string) error

func CloseDB

func CloseDB()

CloseDB closes database connection (unnecessary)

func GetAccount

func GetAccount()

func Setup

func Setup()

Setup initializes the database instance

Types

type Account

type Account struct {
	ID          int    `gorm:"primary_key" json:"id"`
	UserID      string `json:"username"`
	Username    string `json:"user_id"`
	LoginType   string `json:"login_type"`
	Country     string `json:"country"`
	Email       string `json:"email"`
	UserPicture string `json:"user_picture"`
	TeamID      string `json:"team_id"`
}

func ExistAccountByUserID

func ExistAccountByUserID(userid string) (*Account, error)

ExistAccountByUserID checks if there is a account with the same user_id

type Player

type Player struct {
	ID          int    `gorm:"primary_key" json:"id"`
	PlayerName  string `json:"player_name"`
	SquadNumber string `json:"squad_number"`
	TeamNumber  string `json:"team_number"`
	TeamId      int    `json:"team_id"`
	Nation      string `json:"nation"`
	Height      int    `json:"height"`
	Weight      int    `json:"weight"`
	Age         int    `json:"age"`
	Foot        string `json:"foot"`
	Position    string `json:"position"`
	BallControl int    `json:"ball_control"`
	Dribbling   int    `json:"dribbling"`
	Low_pass    int    `json:"low_pass"`
	Lofted_pass int    `json:"lofted_pass"`
	Speed       int    `json:"speed"`
	Jump        int    `json:"jump"`
}

func GetPlayerListByTeamID

func GetPlayerListByTeamID(teamid int) ([]*Player, error)

type Team

type Team struct {
	ID          int    `gorm:"primary_key" json:"id"`
	TeamName    string `json:"team_name"`
	ManagerName string `json:"manager_name"`
	Formation   string `json:"formation"`
}

func GetAllTeamList

func GetAllTeamList() ([]*Team, error)

Jump to

Keyboard shortcuts

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