note

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: MIT Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(n CommitNote) string

Marshal converts a commit note to a serialized string

Types

type CommitNote

type CommitNote struct {
	Files  []FileDetail
	Branch string
}

CommitNote contains the time metrics for a commit

func UnMarshal

func UnMarshal(s string) (CommitNote, error)

UnMarshal unserializes a git note string into a commit note

func (CommitNote) FilterOutApp

func (n CommitNote) FilterOutApp() CommitNote

FilterOutApp filters out app time from commit note

func (CommitNote) FilterOutSubdir

func (n CommitNote) FilterOutSubdir(subdir string) CommitNote

FilterOutSubdir removes all notes not related to subdir

func (CommitNote) FilterOutTerminal

func (n CommitNote) FilterOutTerminal() CommitNote

FilterOutTerminal filters out terminal time from commit note

func (CommitNote) Total

func (n CommitNote) Total() int

Total returns the total time for a commit note

type FileByTime

type FileByTime []FileDetail

FileByTime is list of FileDetails

func (FileByTime) Len

func (a FileByTime) Len() int

func (FileByTime) Less

func (a FileByTime) Less(i, j int) bool

func (FileByTime) Swap

func (a FileByTime) Swap(i, j int)

type FileDetail

type FileDetail struct {
	SourceFile string
	TimeSpent  int
	Timeline   map[int64]int
	Status     string
}

FileDetail contains a source file's time metrics

func (*FileDetail) GetAppName

func (f *FileDetail) GetAppName() string

GetAppName returns the name of the App

func (*FileDetail) GetEventType

func (f *FileDetail) GetEventType() string

func (*FileDetail) IsApp

func (f *FileDetail) IsApp() bool

IsApp returns true if file is an app event

func (*FileDetail) IsTerminal

func (f *FileDetail) IsTerminal() bool

IsTerminal returns true if file is terminal

func (*FileDetail) ShortenSourceFile

func (f *FileDetail) ShortenSourceFile(n int) string

ShortenSourceFile shortens source file to length n

func (*FileDetail) SortEpochs

func (f *FileDetail) SortEpochs() []int64

SortEpochs returns timeline keys sorted by epoch

Jump to

Keyboard shortcuts

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