domain

package
v0.0.0-...-19ed411 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoesUserConfigExist

func DoesUserConfigExist() (bool, error)

DoesUserConfigExist checks if a user config has already be generated for this user.

func GetConfigDirPathBasedOnOS

func GetConfigDirPathBasedOnOS() (string, error)

GetConfigFilePathBasedOnOS returns the config folder path based on the OS.

func GetConfigFilePathBasedOnOS

func GetConfigFilePathBasedOnOS() (string, error)

GetConfigFilePathBasedOnOS returns the config file path based on the OS.

func GetLogsFilePathBasedOnOS

func GetLogsFilePathBasedOnOS() (string, error)

GetLogsFilePathBasedOnOS returns the logs file path based on the OS.

Types

type Board

type Board struct {
	Name    string   `json:"name"`
	Dir     string   `json:"dir"`
	Columns []string `json:"columns"`
	// Tasks are the individual cards on the board representing a task.
	Tasks map[string][]*Task `json:"tasks"`
}

func (*Board) GetColumnForTask

func (board *Board) GetColumnForTask(task *Task) (string, int)

GetColumnForTask returns the name and the index of the column that this task belongs to. It returns -1 as the index if didn't find the column.

func (*Board) IsEmpty

func (board *Board) IsEmpty() bool

type Task

type Task struct {
	Id    string `json:"id"`
	Title string `json:"title"`
	// Optional
	Description string `json:"description"`
	// Column      string `json:"column"`
	CreatedAt string `json:"created_at"`
}

func NewTask

func NewTask(title string, description string) *Task

type UserConfig

type UserConfig struct {
	PrimaryColor termui.Color `json:"primary_color"`
	Boards       []*Board     `json:"boards"`
}

func GetUserConfig

func GetUserConfig() (*UserConfig, error)

GetUserConfig reads the user config file and returns a pointer to a UserConfig object.

func NewDefaultUserConfig

func NewDefaultUserConfig() *UserConfig

func SetupUserConfig

func SetupUserConfig() (*UserConfig, error)

SetupUserConfig creates a new default config and writes it to disk. It returns a pointer to the new config.

func (*UserConfig) AddColumnToBoard

func (self *UserConfig) AddColumnToBoard(boardName string, columnName string) error

AddColumnToBoard adds a column to the board of the board with the given name.

func (*UserConfig) AddTask

func (self *UserConfig) AddTask(boardName string, task *Task) error

AddTask adds a new task to the left most column (idealy called Backlog).

func (*UserConfig) CreateBoard

func (self *UserConfig) CreateBoard(boardName string, dirPath string) error

CreateBoard adds a new board to the config.

func (*UserConfig) DeleteTask

func (self *UserConfig) DeleteTask(boardName string, task *Task) error

func (*UserConfig) GetBoard

func (self *UserConfig) GetBoard(boardName string) opt.Option[*Board]

GetBoard searches the config for a board with the given name.

func (*UserConfig) MoveTaskLeft

func (self *UserConfig) MoveTaskLeft(board *Board, task *Task) error

MoveTaskLeft moves the task to the left column of the one its currently on and removes it from the old column.

func (*UserConfig) MoveTaskRight

func (self *UserConfig) MoveTaskRight(board *Board, task *Task) error

MoveTaskRight moves the task to the right column of the one its currently on and removes it from the old column.

func (*UserConfig) UpdateBoard

func (self *UserConfig) UpdateBoard(board *Board) error

UpdateBoard finds and updates the given board in the user config.

Jump to

Keyboard shortcuts

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