database

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaVersion = 2

Variables

This section is empty.

Functions

func AddNewClient

func AddNewClient(name string) error

func AddNewTask

func AddNewTask(clientName, name string) error

func ClientExists

func ClientExists(clientName string) (bool, error)

func ConfirmDeleteClient

func ConfirmDeleteClient(name string) (bool, error)

func DeleteClient

func DeleteClient(clientName string, force bool) error

func DeleteTask

func DeleteTask(clientName, taskName string) error

func GetAll

func GetAll() (map[string]Tasks, error)

func GetDBPath

func GetDBPath() (string, error)

func InitDb

func InitDb() (*sql.DB, error)

func SelectClientForTimer

func SelectClientForTimer() (string, error)

func SelectTaskForClient

func SelectTaskForClient(clientName string) (string, error)

func StartTimer

func StartTimer(clientName, taskName string) error

func StopTimer

func StopTimer() (string, string, error)

func UpdateTaskMinutes

func UpdateTaskMinutes(clientName, taskName string, newMinutes float32, subtract bool) error

Types

type Project

type Project struct {
	Name  string `json:"Name"`
	Hours int    `json:"Hours"`
}

type Projects

type Projects map[string]Project

type Tasks

type Tasks map[string]int

func GetClientTasks

func GetClientTasks(clientName string) (Tasks, error)

type Timer

type Timer struct {
	ClientName string
	TaskName   *string // pointer = optional
	StartTime  time.Time
}

func GetTimer

func GetTimer() (Timer, bool, error)

Jump to

Keyboard shortcuts

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