work

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	Database *gorm.DB
}

Repository used to fetch work task data from the database.

func (*Repository) CreateWorkTask

func (r *Repository) CreateWorkTask(task Task) error

CreateWorkTask will store a work task in the database.

func (*Repository) GetAllWorkTasks

func (r *Repository) GetAllWorkTasks() ([]Task, error)

GetAllWorkTasks will retrieve all work tasks from the database.

type Task

type Task struct {
	gorm.Model
	Name     string
	Duration time.Duration
}

Task is the model stored in the database.

func (Task) TableName

func (Task) TableName() string

TableName returns the name of database table where work tasks are stored.

Jump to

Keyboard shortcuts

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