Documentation ¶
Index ¶
- Constants
- Variables
- func EditConfig() error
- func Log(q FramesQuery, oneLine bool, verbose bool, quiet bool)
- func Report(q FramesQuery)
- func SetConfig(key string, value interface{})
- func WriteConfigToFile() error
- type Config
- type EditFrameOpts
- type Frame
- func (f *Frame) AddWorkLog()
- func (f Frame) Duration() TrackerDuration
- func (f Frame) Equals(other Frame) bool
- func (f Frame) Finished() bool
- func (f Frame) FormattedEndTime() string
- func (f Frame) FormattedProject() string
- func (f Frame) FormattedStartTime() string
- func (f Frame) FormattedTags() string
- func (f Frame) InProgress() bool
- func (f *Frame) MarshalJSON() ([]byte, error)
- func (f Frame) RelativeTime() string
- func (f *Frame) UnmarshalJSON(data []byte) error
- type Frames
- func (f Frames) ByPosition(pos int) (int, Frame)
- func (f Frames) ByUUID(uuid string) (int, Frame)
- func (f Frames) Frames() []string
- func (f Frames) Len() int
- func (f Frames) Less(i, j int) bool
- func (f Frames) MaxDate() time.Time
- func (f *Frames) Merge(other Frames) (int, int)
- func (f Frames) MinDate() time.Time
- func (f Frames) Persist()
- func (f Frames) Projects() []string
- func (f Frames) Swap(i, j int)
- func (f Frames) Tags() []string
- type FramesQuery
- type TrackerDuration
Constants ¶
View Source
const ( LongDateFormat = "Monday 02 Jan 2006" DateTimeFormat = "02.01.2006 15:04" TimeFormat = "15:04" DateFormat = "2006-01-02" )
Variables ¶
View Source
var DateLocation = time.Now().Location()
View Source
var DefaultConfig = []byte(`
[core]
editor = "vim"
[colors]
enabled = true
[log]
defaultStartDate = -14
defaultEndDate = 0
[backend]
token = ""
url = ""
user = ""
autoAddWorkLog = false
`)
Functions ¶
func EditConfig ¶
func EditConfig() error
func Report ¶
func Report(q FramesQuery)
func WriteConfigToFile ¶
func WriteConfigToFile() error
Types ¶
type EditFrameOpts ¶
type Frame ¶
type Frame struct { Start time.Time End time.Time Project string Tags []string Uuid string LastEdit time.Time Comment string Synced bool }
func EditFrame ¶
func EditFrame(opts EditFrameOpts) (Frame, error)
func (*Frame) AddWorkLog ¶
func (f *Frame) AddWorkLog()
func (Frame) Duration ¶
func (f Frame) Duration() TrackerDuration
func (Frame) FormattedEndTime ¶
func (Frame) FormattedProject ¶
func (Frame) FormattedStartTime ¶
func (Frame) FormattedTags ¶
func (Frame) InProgress ¶
func (*Frame) MarshalJSON ¶
func (Frame) RelativeTime ¶
func (*Frame) UnmarshalJSON ¶
type Frames ¶
type Frames []Frame
func GetFramesFiltered ¶
func GetFramesFiltered(q FramesQuery) Frames
type FramesQuery ¶
type FramesQuery struct { Projects map[string]struct{} Tags map[string]struct{} From time.Time To time.Time }
func NewFrameQuery ¶
func NewFrameQuery(projects, tags []string, from, to string) (FramesQuery, error)
type TrackerDuration ¶
func (TrackerDuration) String ¶
func (t TrackerDuration) String() string
Click to show internal directories.
Click to hide internal directories.