models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FmtDuration

func FmtDuration(d time.Duration) string

func IsTrackingActive

func IsTrackingActive(u string) bool

func SetFont

func SetFont(user, font string)

func SetRefresh

func SetRefresh(user string, refresh int)

func SetTheme

func SetTheme(user, theme string)

func Tracked

func Tracked(u string) string

func TrackingActive

func TrackingActive(u string, p Project)

func TrackingInactive

func TrackingInactive(u string)

Types

type Config

type Config struct {
	Theme   string `json:"theme" form:"theme"`
	Font    string `json:"font" form:"font"`
	Refresh int    `json:"refresh" form:"refresh"`
}

type DatabaseReportRequest

type DatabaseReportRequest struct {
	Start   time.Time
	End     time.Time
	Project string
	User    string
}

type Duration

type Duration struct {
	Project string
	Elapsed string
}

type Durations

type Durations map[string]string

type EditRecord

type EditRecord struct {
	ID        string
	Start     string
	StartTime string
	End       string
	EndTime   string
}

type ErrorMessage

type ErrorMessage struct {
	Status  string
	Message string
}

func (*ErrorMessage) Process

func (e *ErrorMessage) Process(c *gin.Context)

type Page

type Page struct {
	NeedsLogin  bool
	Version     string
	Theme       string
	Font        string
	Refresh     int
	Tracking    bool
	Projects    []string
	Status      StatusResponse
	DefaultDate string
}

func GetPage

func GetPage() Page

func GetUserPage

func GetUserPage(u string) Page

type Project

type Project struct {
	ID      uuid.UUID
	Name    string
	Active  bool
	Updated time.Time
}

type Record

type Record struct {
	ID      uuid.UUID
	Project string
	User    string
	Start   time.Time
	End     time.Time
}

func (*Record) Duration

func (r *Record) Duration() time.Duration

type Report

type Report struct {
	Project string
	Total   string
	Items   []ReportRecord
}

type ReportRecord

type ReportRecord struct {
	ID    uuid.UUID
	Start time.Time
	End   time.Time
}

type ReportRequest

type ReportRequest struct {
	Start   string `json:"start" form:"start"`
	End     string `json:"end" form:"end"`
	Project string `json:"project" form:"project"`
}

type StartRequest

type StartRequest struct {
	Project string
}

type Status

type Status struct {
	Current    string
	Elapsed    time.Duration
	Total      time.Duration
	DailyTotal time.Duration
}

type StatusResponse

type StatusResponse struct {
	Current      string
	Elapsed      string
	CurrentTotal string
	DailyTotal   string
	Durations    []Duration
}

type User

type User struct {
	Username string `json:"username" form:"username"`
	Password string `json:"password" form:"password"`
	IsAdmin  bool
	Updated  time.Time
}

Jump to

Keyboard shortcuts

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