database

package
v0.0.0-...-29a1262 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sql.DB

Functions

func CheckIfUserExists

func CheckIfUserExists(login string) (bool, error)

func GetSettings

func GetSettings(login string) (map[string]int, error)

func GetUserPassword

func GetUserPassword(login string) (string, error)

func InitDB

func InitDB()

func InsertAgentIntoDB

func InsertAgentIntoDB(agent *Agent) error

func InsertClIntoDB

func InsertClIntoDB(c *Calculation) error

func InsertUserIntoDB

func InsertUserIntoDB(u *User) error

func UpdateUserPassword

func UpdateUserPassword(login, password string) error

Types

type Agent

type Agent struct {
	ID         int
	Last_Seen  string
	Status     string
	Goroutines int
	Dead_Time  string
}

func GetAgentsFromDB

func GetAgentsFromDB() ([]Agent, error)

type Calculation

type Calculation struct {
	ID         int
	Login      string
	Expression string
	Status     string
	Answer     float64
}

func GetClsFromDB

func GetClsFromDB(login string) ([]Calculation, error)

type User

type User struct {
	ID       int
	Login    string `json:"login" validate:"required"`
	Password string `json:"password" validate:"required"`
}

func GetUsersFromDB

func GetUsersFromDB() ([]User, error)

Jump to

Keyboard shortcuts

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