entry

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const NUM_RECORDS = 3

Variables

This section is empty.

Functions

func Append added in v0.6.0

func Append(file io.Writer, entry Entry) error

func AppendFile added in v0.6.0

func AppendFile(path string, entry Entry) error

func Compare

func Compare(a, b Entry) int

func DurationMap added in v0.4.0

func DurationMap(entries []Entry, cutoff time.Time) map[string]time.Duration

TODO: This function is never used...

func Total added in v0.4.0

func Total(totals map[string]time.Duration) time.Duration

TODO: This function is not used either...

Types

type Entry

type Entry struct {
	Time     time.Time `json:"time"`
	Category string    `json:"category"` // TODO: Make its own type with sub categories ex: "foo/bar"
	Note     string    `json:"note"`
}

func Filter

func Filter(entries []Entry, start, end time.Time) []Entry

func ReadAll

func ReadAll(file io.Reader) ([]Entry, error)

func ReadAllFromFile added in v0.6.0

func ReadAllFromFile(path string) ([]Entry, error)

func (*Entry) UnmarshalJSON added in v0.9.0

func (entry *Entry) UnmarshalJSON(b []byte) error

type FileHandler added in v0.9.0

type FileHandler struct {
	// contains filtered or unexported fields
}

func NewFileHandler added in v0.9.0

func NewFileHandler(filename string) (*FileHandler, error)

func (*FileHandler) CreateEntry added in v0.9.0

func (handler *FileHandler) CreateEntry(newEntry Entry) error

func (*FileHandler) GetAllEntries added in v0.9.0

func (handler *FileHandler) GetAllEntries(options ...Option) ([]Entry, error)

type Option added in v0.9.0

type Option func([]Entry) ([]Entry, error)

func Today added in v0.9.0

func Today() Option

type ScheduleEntry added in v0.9.0

type ScheduleEntry struct {
	Entry    Entry
	Duration time.Duration
}

type Summary added in v0.9.0

type Summary struct {
	Schedule   []ScheduleEntry
	Categories map[string]time.Duration
	Total      time.Duration
}

func Summarize added in v0.9.0

func Summarize(entries []Entry) Summary

Jump to

Keyboard shortcuts

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