core

package
v0.0.0-...-53dec70 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	START = 1
	END   = 0
)

Variables

View Source
var NIL_TIME time.Time = time.Time{}

Functions

func Bold

func Bold(str string) string

func GenerateGanttChart

func GenerateGanttChart(records TaskRecords) (chart string)
func GenerateLogo() (logo string)

func ListTasks

func ListTasks(taskRecords TaskRecords, allOrActive bool, verboseOrNot bool, tags []string) (taskString string)

func TakeNote

func TakeNote(note string, tasks []Task)

func TerminalWidth

func TerminalWidth() int

func WriteNotesToNotesFile

func WriteNotesToNotesFile(notesRecord NotesRecord) error

func WriteTasksToTaskFile

func WriteTasksToTaskFile(taskRecords TaskRecords)

Types

type Note

type Note struct {
	Tasks    []string
	Time     time.Time
	NoteText string
}

type NotesRecord

type NotesRecord struct {
	Notes []Note
}

func ReadNotesFromNotesFile

func ReadNotesFromNotesFile() (notesRecord NotesRecord)

Read tasks edn from file and return them

type Task

type Task struct {
	Name          string
	Priority      int
	Tags          []string
	TaskIntervals []TaskInterval
}

func GetActiveTasks

func GetActiveTasks(taskRecords TaskRecords) (activeTasks []Task)

Gets all tasks that are most recent and have tag START

func MakeTask

func MakeTask(name string, priority int, tags []string) (task Task)

type TaskInterval

type TaskInterval struct {
	StartTime time.Time
	EndTime   time.Time
}

type TaskRecords

type TaskRecords struct {
	Record map[string]*Task
}
var NIL_RECORDS TaskRecords

func ClockIn

func ClockIn(taskRecords TaskRecords, taskName string, timeStampValue time.Time) (newTaskRecords TaskRecords, startError error)

Function to start a task and write it to file

func ClockOut

func ClockOut(taskRecords TaskRecords, taskName string, timeStampValue time.Time) (records TaskRecords, endError error)

Function to end a task that has already been started

func ReadTasksFromTasksFile

func ReadTasksFromTasksFile() (taskRecords TaskRecords)

Read tasks edn from file and return them

func UpdateTask

func UpdateTask(taskRecords TaskRecords, name string, priority int, tags []string) TaskRecords

Jump to

Keyboard shortcuts

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