task

package
v0.0.0-...-629b230 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExpTaskIsNilPointer = errors.New("cannot create user by nil task pointer")
)

Functions

func DeleteExpTaskByID

func DeleteExpTaskByID(expTaskID uint64) error

func GetExpTaskUserIDByID

func GetExpTaskUserIDByID(expTaskID uint64) (uint64, error)

func IsExpTaskExists

func IsExpTaskExists(expTaskID uint64) (bool, error)

func IsExpTaskFilenameUsed

func IsExpTaskFilenameUsed(filename string) (bool, error)

func IsExpTaskTitleUsed

func IsExpTaskTitleUsed(title string) (bool, error)

Types

type ExpTask

type ExpTask struct {
	basic.Model
	Title    string             `json:"title"`
	Filename string             `json:"filename"`
	Deadline time.Time          `json:"deadline"`
	UserID   *uint64            `json:"-"`
	User     *user.User         `json:"user"`
	Reports  []report.ExpReport `json:"reports"`
}

func GetAllExpTasks

func GetAllExpTasks() ([]ExpTask, error)

func GetExpTaskByID

func GetExpTaskByID(expTaskID uint64) (*ExpTask, error)

func NewExpTask

func NewExpTask(title, filename string, deadline time.Time, userID uint64) ExpTask

func (*ExpTask) Create

func (t *ExpTask) Create() error

func (*ExpTask) UpdateTitleAndDeadline

func (t *ExpTask) UpdateTitleAndDeadline(title string, deadline time.Time) error

Jump to

Keyboard shortcuts

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