db

package
v0.0.0-...-4de2adc Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteDbFile

func DeleteDbFile() error

func ExistsDbFile

func ExistsDbFile() error

func InitDb

func InitDb()

Types

type Project

type Project struct {
	gorm.Model
	Title      string `gorm:"type:varchar(255);not null"`
	CurrentFlg bool   `gorm:"type:boolean;not null;default false"`
}

type ProjectRepository

type ProjectRepository interface {
	Insert(project *Project) error
	Update(project *Project) error
	GetList() *[]Project
	CheckExistsCurrentProject() bool
	GetCurrentProject() *Project
}

type ProjectRepositoryImpl

type ProjectRepositoryImpl struct{}

func (*ProjectRepositoryImpl) CheckExistsCurrentProject

func (t *ProjectRepositoryImpl) CheckExistsCurrentProject() bool

func (*ProjectRepositoryImpl) FindById

func (t *ProjectRepositoryImpl) FindById(id int) *Project

func (*ProjectRepositoryImpl) GetCurrentProject

func (t *ProjectRepositoryImpl) GetCurrentProject() *Project

func (*ProjectRepositoryImpl) GetList

func (t *ProjectRepositoryImpl) GetList() *[]Project

func (*ProjectRepositoryImpl) Insert

func (t *ProjectRepositoryImpl) Insert(project *Project) error

func (*ProjectRepositoryImpl) Update

func (t *ProjectRepositoryImpl) Update(project *Project) error

type Task

type Task struct {
	gorm.Model
	Title     string    `gorm:"type:varchar(255);not null"`
	Label     string    `gorm:"type:varchar(64)"`
	Status    string    `gorm:"type:varchar(32)"`
	DueDate   time.Time `gorm:""`
	Priority  int       `gorm:""`
	HideFlg   bool      `gorm:"type:boolean;not null;default false"`
	ProjectID uint
}

func (*Task) GetDueDate

func (t *Task) GetDueDate() string

func (*Task) GetTitle

func (t *Task) GetTitle() string

type TaskRepository

type TaskRepository interface {
	Insert(task *Task) error
	Update(task *Task) error
	GetList(allFlag bool, label string, sort string) *[]Task
	FindById(id int) *Task
	DeleteTask(id int)
}

type TaskRepositoryImpl

type TaskRepositoryImpl struct{}

func (*TaskRepositoryImpl) DeleteTask

func (p *TaskRepositoryImpl) DeleteTask(id int)

func (*TaskRepositoryImpl) FindById

func (p *TaskRepositoryImpl) FindById(id int) *Task

func (*TaskRepositoryImpl) GetList

func (t *TaskRepositoryImpl) GetList(allFlag bool, label string, sort string) *[]Task

func (*TaskRepositoryImpl) Insert

func (t *TaskRepositoryImpl) Insert(task *Task) error

func (*TaskRepositoryImpl) Update

func (t *TaskRepositoryImpl) Update(task *Task) error

Jump to

Keyboard shortcuts

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