db

package
v0.0.0-...-90cd65b Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusActive    Status = "active"
	StatusPaused           = "paused"
	StatusCompleted        = "completed"
)
View Source
const (
	TaskStatusTodo       TaskStatus = "todo"
	TaskStatusInProgress            = "inProgress"
	TaskStatusCompleted             = "completed"
)

Variables

This section is empty.

Functions

func Open

func Open(url string) (*sqlx.DB, error)

func RunMigrations

func RunMigrations(con *sqlx.DB) error

Types

type DateTime

type DateTime time.Time

func Now

func Now() DateTime

func (*DateTime) Scan

func (d *DateTime) Scan(src interface{}) error

func (DateTime) Value

func (d DateTime) Value() (driver.Value, error)

type Project

type Project struct {
	Id     string
	Name   string
	Status Status
	Tasks  []*Task
}

func NewProject

func NewProject() *Project

type ProjectStore

type ProjectStore struct {
	// contains filtered or unexported fields
}

func NewProjectStore

func NewProjectStore(con *sqlx.DB) *ProjectStore

func (*ProjectStore) Delete

func (s *ProjectStore) Delete(id string) error

func (*ProjectStore) DeleteByName

func (s *ProjectStore) DeleteByName(name string) error

func (*ProjectStore) Get

func (s *ProjectStore) Get(id string) (*Project, error)

func (*ProjectStore) GetAll

func (s *ProjectStore) GetAll() ([]*Project, error)

func (*ProjectStore) Insert

func (s *ProjectStore) Insert(project *Project) error

func (*ProjectStore) Save

func (s *ProjectStore) Save(project *Project) error

func (*ProjectStore) Update

func (s *ProjectStore) Update(project *Project) error

type Status

type Status string

type Task

type Task struct {
	Id            string
	Description   string
	DateGet       DateTime `db:"dateGet"`
	DateStart     DateTime `db:"dateStart"`
	DateCompleted DateTime `db:"dateCompleted"`
	Priority      int
	Progress      int
	Note          string
	Status        TaskStatus
	Project       *Project
	ProjectId     string `db:"projectId"`
}

func NewTask

func NewTask() *Task

type TaskStatus

type TaskStatus string

type TaskStore

type TaskStore struct {
	// contains filtered or unexported fields
}

func NewTaskStore

func NewTaskStore(con *sqlx.DB) *TaskStore

func (*TaskStore) Delete

func (s *TaskStore) Delete(id string) error

func (*TaskStore) Get

func (s *TaskStore) Get(id string) (*Task, error)

func (*TaskStore) GetAll

func (s *TaskStore) GetAll() ([]*Task, error)

func (*TaskStore) GetAllByProjectId

func (s *TaskStore) GetAllByProjectId(projectId string) ([]*Task, error)

func (*TaskStore) GetAllByProjectName

func (s *TaskStore) GetAllByProjectName(projectName string) ([]*Task, error)

func (*TaskStore) Insert

func (s *TaskStore) Insert(task *Task) error

func (*TaskStore) Save

func (s *TaskStore) Save(task *Task) error

func (*TaskStore) Update

func (s *TaskStore) Update(task *Task) error

Jump to

Keyboard shortcuts

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