core

package
v0.0.0-...-881b286 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PORT    string = ":3000"
	DB_FILE string = "base.db"
)

constant declarations

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Config   Config
	Server   *echo.Echo
	Database *Database
}

func NewApplication

func NewApplication(config Config) *Application

func (*Application) ConnectDatabase

func (app *Application) ConnectDatabase(config gorm.Config) *Application

func (*Application) Listen

func (app *Application) Listen() error

type Config

type Config struct {
	Port string
}

type Database

type Database struct {
	Client *gorm.DB
}

func NewDatabase

func NewDatabase(gorm_config gorm.Config) *Database

func (*Database) HandleMigrations

func (DB *Database) HandleMigrations()

type Project

type Project struct {
	ID        string    `gorm:"primaryKey"`
	Name      string    `gorm:"not null"`
	Sections  []Section `gorm:"foreignKey:ProjectID; constraint:OnDelete:CASCADE;"`
	CreatedAt int64     `gorm:"autoUpdateTime:nano"`
	UpdatedAt int64     `gorm:"autoCreateTime:nano"`
}

----- `Project` model

type Section

type Section struct {
	ID        string `gorm:"primaryKey"`
	Heading   string `gorm:"not null"`
	ProjectID string `gorm:"not null"`
	Tasks     []Task `gorm:"foreignKey:SectionID; constraint:OnDelete:CASCADE;"`
	CreatedAt int64  `gorm:"autoUpdateTime:nano"`
	UpdatedAt int64  `gorm:"autoCreateTime:nano"`
}

----- `Section` model

type SubTask

type SubTask struct {
	ID          string `gorm:"primaryKey"`
	Heading     string `gorm:"not null"`
	Description string
	Priority    uint   `gorm:"not null; default:4"`
	Done        bool   `gorm:"not null; default:false"`
	TaskID      string `gorm:"not null"`
	CreatedAt   int64  `gorm:"autoUpdateTime:nano"`
	UpdatedAt   int64  `gorm:"autoCreateTime:nano"`
}

----- `SubTask` model

type Task

type Task struct {
	ID          string `gorm:"primaryKey"`
	Heading     string `gorm:"not null"`
	Description string
	Priority    uint      `gorm:"not null; default:4"`
	Done        bool      `gorm:"not null; default:false"`
	SectionID   string    `gorm:"not null"`
	SubTasks    []SubTask `gorm:"foreignKey:TaskID; constraint:OnDelete:CASCADE;"`
	CreatedAt   int64     `gorm:"autoUpdateTime:nano"`
	UpdatedAt   int64     `gorm:"autoCreateTime:nano"`
}

----- `Task` model

Jump to

Keyboard shortcuts

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