apis

package
v0.0.0-...-8dd3885 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	View          = "view"
	ViewAndUpdate = "view_and_update"
)
View Source
const (
	Closed State = "closed"
	Open   State = "open"

	Backlog   Status = "backlog"
	Todo      Status = "todo"
	Doing     Status = "doing"
	Done      Status = "done"
	Abandoned Status = "abandoned"
)

Variables

This section is empty.

Functions

func IsValidStatus

func IsValidStatus(s Status) bool

func StatusStrings

func StatusStrings() []string

Types

type Annotation

type Annotation struct {
	ID        uint           `gorm:"primarykey" json:"id"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`

	TaskID      uint   `json:"taskid"`
	Description string `json:"description"`
}

type Comment

type Comment struct {
	ID        uint           `gorm:"primarykey" json:"id"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index"`

	TaskID      uint   `json:"taskid"`
	Description string `json:"description"`
}

type Policy

type Policy struct {
	OwnerUserId    uint `json:"owner_user_id" gorm:"primaryKey"`
	DelegateUserId uint `json:"delegate_user_id" gorm:"primaryKey"`

	Mode PolicyMode `json:"mode"`

	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type PolicyMode

type PolicyMode string

type Priority

type Priority uint8

Priority is how urgent the task is. 0 is lowest priority.

type State

type State string

State is either open or closed

type Status

type Status string

Status is one of backlog, todo, doing, done, abandoned

func Statuses

func Statuses() []Status

type Task

type Task struct {
	ID        uint           `gorm:"primaryKey" json:"id"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`

	OwnerId uint `json:"owner_id"`
	Owner   User `gorm:"foreignKey:ID;references:OwnerId"`

	AssigneeId uint `json:"assignee_id"`
	Assignee   User `gorm:"foreignKey:ID;references:AssigneeId"`

	Description string       `json:"desc"`
	Due         *time.Time   `json:"due"`
	Priority    Priority     `json:"priority"`
	Private     bool         `json:"private"`
	State       State        `json:"state"`
	Status      Status       `json:"status"`
	Comments    []Comment    `json:"comments" gorm:"constraint:OnDelete:CASCADE"`
	Annotations []Annotation `json:"annotations" gorm:"constraint:OnDelete:CASCADE"`
}

Task is some unit of work to do

func (*Task) Bind

func (t *Task) Bind(r *http.Request) error

type TaskList

type TaskList struct {
	Tasks []Task `json:"tasks"`
}

type User

type User struct {
	ID        uint           `gorm:"primaryKey" json:"id"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`

	Username string `gorm:"unique" json:"username"`
	Name     string `gorm:"not null" json:"name"`

	OwnedTasks    []Task `gorm:"foreignKey:OwnerId;constraint:OnDelete:CASCADE"`
	AssignedTasks []Task `gorm:"foreignKey:AssigneeId"`

	SharedWith []Policy `gorm:"foreignKey:OwnerUserId;constraint:OnDelete:CASCADE"`
	SharedFrom []Policy `gorm:"foreignKey:DelegateUserId;constraint:OnDelete:CASCADE"`
}

Jump to

Keyboard shortcuts

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