models

package
v0.0.0-...-3399a5c Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 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 ML

type ML struct {
	ModelID          int    `json:"modelid"`
	UserID           string `json:"userid"`
	ModelDescription string `json:"modeldescription"`
	CategoryID       int    `json:"categoryid"`
	FolderName       string `json:"foldername"`
	Downloadable     bool   `json:"downloadable"`
	CategoryName     string `json:"categoryname"`
}

type MLModel

type MLModel struct {
	DB *sql.DB
}

func (MLModel) DeleteModelFromDB

func (m MLModel) DeleteModelFromDB(modelID int) (bool, error)

func (MLModel) GetAllModelsByUserFromDB

func (m MLModel) GetAllModelsByUserFromDB(userID string) ([]ML, error)

func (MLModel) InsertModelToDB

func (m MLModel) InsertModelToDB(ml ML) (bool, error)

func (MLModel) InsertTrainingDataToDB

func (m MLModel) InsertTrainingDataToDB(tr Training) (bool, error)

func (MLModel) UpdateModelDescriptionToDB

func (m MLModel) UpdateModelDescriptionToDB(modelID int, modelDescription string) (bool, error)

type Training

type Training struct {
	TrainingDataID int    `json:"trainingdataid"`
	CategoryID     int    `json:"categoryid"`
	FolderName     string `json:"foldername"`
	DataName       string `json:"dataname"`
}

type User

type User struct {
	UserID   string `json:"userid"`
	UserName string `json:"username"`
	Password string `json:"password"`
}

User Model for table MsUser

type UserModel

type UserModel struct {
	DB *sql.DB
}

UserModel Db connection

func (UserModel) DeleteUserFromDB

func (m UserModel) DeleteUserFromDB(userID string) (bool, error)

DeleteUserFromDB Hard deletes a user from db

func (UserModel) GetUserFromDB

func (m UserModel) GetUserFromDB(userID string) (User, error)

GetUserFromDB Gets specific user from DB

func (UserModel) GetUserPasswordFromDB

func (m UserModel) GetUserPasswordFromDB(username string) (string, error)

func (UserModel) InsertUserToDB

func (m UserModel) InsertUserToDB(user User) (string, error)

InsertUserToDB Insert one user to Db

func (UserModel) UpdateUserToDB

func (m UserModel) UpdateUserToDB(user User) (bool, error)

UpdateUserToDB Update specific user to db

Jump to

Keyboard shortcuts

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