gitstats

package
Version: v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitCmdLocalClient

type GitCmdLocalClient struct {
	Path string
}

GitCmdLocalClient works with local git through os commands

func (*GitCmdLocalClient) Clone

func (g *GitCmdLocalClient) Clone(gitURL url.URL) error

Clone git repo

func (*GitCmdLocalClient) DirPath

func (g *GitCmdLocalClient) DirPath(gitURL url.URL) string

DirPath gets path where git repo is stored locally

func (*GitCmdLocalClient) GetGitLog

func (g *GitCmdLocalClient) GetGitLog(gitURL url.URL) (GitLog, error)

GetGitLog fetches git log entries given path for git

type GitLog

type GitLog []GitLogEntry

GitLog is sequence of git log entries in reverse chronological order (i.e. first is latest)

func (GitLog) DaysSinceLastCommit

func (logs GitLog) DaysSinceLastCommit() float64

DaysSinceLastCommit returns partial days since last commit

func (GitLog) NumContributors

func (logs GitLog) NumContributors() uint

NumContributors returns number of contributors in log

type GitLogEntry

type GitLogEntry struct {
	AuthorEmail string
	AuthorDate  time.Time
}

GitLogEntry contains info about single git log entry

func NewGitLogEntryFromLine

func NewGitLogEntryFromLine(input string) (GitLogEntry, error)

NewGitLogEntryFromLine git log entry from single row of predefined pretty print format

type GitStats

type GitStats struct {
	LastCommit          time.Time `json:"last_commit,omitempty"`
	DaysSinceLastCommit float64   `json:"last_commit_days_since"`
	NumContributors     uint      `json:"num_contributors"`
}

GitStats contains information about single git repository computed using local git only

type GitStatsFetcher

type GitStatsFetcher struct {
	GitLogFetcher gitLogFetcher
}

GitStatsFetcher computes git stats after fetching using provided storage

func (*GitStatsFetcher) GetGitStats

func (g *GitStatsFetcher) GetGitStats(gitURL url.URL) (*GitStats, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL