Documentation ¶
Index ¶
- func ParseCommitLines(authors string, from, to *time.Time, params *TypeFuncParams) (ok bool, result interface{}, err error)
- func ParseDirNames(dirs string) ([]string, error)
- func ParseLine(commit *Commit, line string)
- func RepoNameFromPath(p string) (string, error)
- func RunGitLog(directory string) (io.Reader, error)
- type Author
- type Change
- type Commit
- type Commits
- type RepoCommitCollection
- type RepoFile
- type RepoFileInfo
- type TypeFuncParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseCommitLines ¶
func ParseCommitLines( authors string, from, to *time.Time, params *TypeFuncParams, ) (ok bool, result interface{}, err error)
ParseCommitLines - Tries to convert a lines of text into a slice of Commits If the format is not a valid one, an error is returned Returns true on first return parameter if there was data available
func ParseDirNames ¶
func RepoNameFromPath ¶
Types ¶
type Change ¶
type Change struct { Added int `json:"added"` Deleted int `json:"removed"` Filename string `json:"filename"` }
Change: represents the file name with full path, the number of additions and the number of removals
type Commit ¶
type Commit struct { Hash string `json:"hash"` Author *Author `json:"author"` Date time.Time `json:"date"` // for the sake of simplicity we deal only with AuthorDate Comment string `json:"-"` // issues with JSON.parse(), need more rework Added int64 `json:"added"` Deleted int64 `json:"removed"` Changes []Change `json:"changes"` }
Commit - Type that holds the information about one single commit
type Commits ¶
type Commits []*Commit
func (Commits) FilesToMap ¶
func (t Commits) FilesToMap(files []*RepoFile) map[string]*RepoFileInfo
type RepoCommitCollection ¶
type RepoCommitCollection struct { Name string `json:"name"` Commits []*Commit `json:"commits"` MinDate int64 `json:"minDate"` MaxDate int64 `json:"maxDate"` // each key is the extension and the value is the sum of its sizes and the count of each file type FileStat map[string]*RepoFileInfo `json:"fileStat"` }
type RepoFileInfo ¶
type TypeFuncParams ¶
Click to show internal directories.
Click to hide internal directories.