note

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2018 License: MIT Imports: 7 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
}

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) FilterOutTerminal added in v1.2.0

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) IsTerminal added in v1.1.0

func (f *FileDetail) IsTerminal() bool

IsTerminal returns true if file is terminal

func (*FileDetail) ShortenSourceFile added in v1.2.10

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