db

package
v0.0.0-...-52ebdcd Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RowNotFound     = 1
	RowNotUnique    = 2
	RowColumnMisuse = 3
)
View Source
const (
	InsertErr = 1
)
View Source
const (
	UpdateErr = 1
)

Variables

View Source
var (
	Conn *gorm.DB
)

Functions

func GetAllTaskProgresses

func GetAllTaskProgresses() []model.TaskProgress

func InsertTaskProgress

func InsertTaskProgress(userID uint, taskID uint, progress string) (*model.TaskProgress, error)

func InsertUser

func InsertUser(username string, password string) (*model.User, error)

func NewConnection

func NewConnection() *gorm.DB

func UpdateTaskProgress

func UpdateTaskProgress(taskProgressID uint, progress string) error

Types

type InsertError

type InsertError struct {
	Status  InsertStatus
	Message string
}

func (InsertError) Error

func (r InsertError) Error() string

type InsertStatus

type InsertStatus uint

type RowError

type RowError struct {
	Status  RowStatus
	Message string
}

func GetAllTasks

func GetAllTasks() ([]model.Task, *RowError)

func GetTaskProgressByUserID

func GetTaskProgressByUserID(userID uint) ([]model.TaskProgress, *RowError)

func GetTaskProgressByUserIDAndTaskID

func GetTaskProgressByUserIDAndTaskID(userID uint, taskID uint) (*model.TaskProgress, *RowError)

func GetUserByUsername

func GetUserByUsername(username string) (*model.User, *RowError)

func (RowError) Error

func (r RowError) Error() string

type RowStatus

type RowStatus uint

type UpdateError

type UpdateError struct {
	Status  UpdateStatus
	Message string
}

func (UpdateError) Error

func (r UpdateError) Error() string

type UpdateStatus

type UpdateStatus uint

Jump to

Keyboard shortcuts

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