Documentation
¶
Index ¶
- func TruncateDay(t time.Time) time.Time
- type Buffer
- type Buffers
- type CodingSession
- type CodingSessions
- func (s CodingSessions) Len() int
- func (s CodingSessions) Less(i, j int) bool
- func (s CodingSessions) MergeByDay() CodingSessions
- func (s CodingSessions) MergeByMonth() CodingSessions
- func (s CodingSessions) MergeByWeek() CodingSessions
- func (s CodingSessions) MergeByYear() CodingSessions
- func (s CodingSessions) Swap(i, j int)
- type Config
- type Event
- type File
- type Files
- type GitFile
- type Repositories
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Buffer ¶
type Buffer struct { OpenedAt time.Time `json:"-"` ClosedAt time.Time `json:"-"` Duration time.Duration `json:"duration"` Filename string `json:"filename"` Filepath string `json:"filepath"` Filetype string `json:"filetype"` Repository string `json:"repository"` }
Buffer rerpresents a buffer that has been edited during a coding session.
type Buffers ¶
type Buffers []Buffer
Buffers represents a slice of buffers that have been edited during a coding session.
type CodingSession ¶
type CodingSession struct { Date time.Time `json:"date"` Duration time.Duration `json:"duration"` Repositories Repositories `json:"repositories"` }
CodingSession represents a coding session that has been aggregated for a given time period (day, week, month, year).
func NewCodingSession ¶
func NewCodingSession(buffers Buffers, now time.Time) CodingSession
func (CodingSession) DateString ¶
func (c CodingSession) DateString() string
func (CodingSession) Merge ¶ added in v0.3.0
func (c CodingSession) Merge(other CodingSession) CodingSession
Merge takes two coding sessions, merges them, and returns the result.
type CodingSessions ¶
type CodingSessions []CodingSession
CodingSessions represents a slice of coding sessions.
func (CodingSessions) Len ¶ added in v0.2.1
func (s CodingSessions) Len() int
func (CodingSessions) Less ¶ added in v0.2.1
func (s CodingSessions) Less(i, j int) bool
func (CodingSessions) MergeByDay ¶
func (s CodingSessions) MergeByDay() CodingSessions
MergeByDay merges sessions that occurred the same day.
func (CodingSessions) MergeByMonth ¶
func (s CodingSessions) MergeByMonth() CodingSessions
MergeByMonth merges sessions that occurred the same month.
func (CodingSessions) MergeByWeek ¶
func (s CodingSessions) MergeByWeek() CodingSessions
MergeByWeek merges sessions that occurred the same week.
func (CodingSessions) MergeByYear ¶
func (s CodingSessions) MergeByYear() CodingSessions
MergeByYear merges sessions that occurred the same year.
func (CodingSessions) Swap ¶ added in v0.2.1
func (s CodingSessions) Swap(i, j int)
type Config ¶
type Config struct { Server struct { Name string Hostname string Port string AggregationInterval time.Duration SegmentationInterval time.Duration SegmentSizeKB int } Database struct { Address string Password string } }
func ParseConfig ¶
type File ¶
type File struct { Name string `json:"name"` Path string `json:"path"` Filetype string `json:"filetype"` Duration time.Duration `json:"duration"` }
File represents a file that has been aggregated for a given time period (day, week, month, year).
type Files ¶
type Files []File
Files represents a slice of files that has been aggregated for a given time period (day, week, month, year).
type Repositories ¶
type Repositories []Repository
Repositories represents a list of git repositories.
type Repository ¶
type Repository struct { Name string `json:"name"` Files Files `json:"files"` Duration time.Duration `json:"duration"` }
Repository represents a git repository. A coding session might open files across any number of repos. The files of the coding session are later grouped by repository.