pkg

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const GitHubAccessTokenKey = "KUNITORI_GITHUB_ACCESS_TOKEN"
View Source
const KunitoriSkipRequestGitHubApi = "KUNITORI_SKIP_REQUEST_GITHUB_API"
View Source
const KunitoriUseGitCommandProvidedKey = "KUNITORI_USE_GIT_COMMAND"
View Source
const SearchCommitMaxLimit = 15

Variables

This section is empty.

Functions

func BlameWithGitCommand

func BlameWithGitCommand(repository *git.Repository, commit *object.Commit, file string) ([]*git.Line, error)

func CloneRepository

func CloneRepository(url string, path string) (*git.Repository, error)

func FindLoginByEmail

func FindLoginByEmail(email string) (string, error)

func GetRemoteLocation

func GetRemoteLocation(repository *git.Repository) (string, error)

func GetRemoteUrl

func GetRemoteUrl(value string) string

func GetSource

func GetSource(value string) string

func IsGitHubAccessTokenProvided

func IsGitHubAccessTokenProvided() bool

func IsUseGitCommandProvided

func IsUseGitCommandProvided() bool

func OpenRepository

func OpenRepository(path string) (*git.Repository, error)

func RenderChartHtml

func RenderChartHtml(generateResult *GenerateResult) (string, error)

func SearchCommits

func SearchCommits(repository *git.Repository, options *SearchCommitsOptions) ([]*object.Commit, error)

func ShowSlowMessage

func ShowSlowMessage()

Types

type Area

type Area struct {
	Name string
	Size float64
}

type AreaAuthor

type AreaAuthor struct {
	Area       Area
	AreaRatio  float64
	Author     string
	AuthorRank int
}

func AllocateAreas

func AllocateAreas(areaInfo *AreaInfo, result *CountLinesResult) ([]*AreaAuthor, error)

type AreaInfo

type AreaInfo struct {
	Region string
	Areas  []Area
}

func GetAreaInfo

func GetAreaInfo(region string) (*AreaInfo, error)

type AuthorRegex

type AuthorRegex struct {
	Condition *regexp2.Regexp
	Author    string
}

type CountLinesOption

type CountLinesOption struct {
	Filters       []*regexp2.Regexp
	AuthorRegexes []AuthorRegex
}

type CountLinesResult

type CountLinesResult struct {
	Filter        *regexp2.Regexp
	LinesByAuthor map[string]int
	NameByAuthor  map[string]string
	MatchedFiles  []string
}

func CountLines

func CountLines(repository *git.Repository, commit *object.Commit, options *CountLinesOption) ([]*CountLinesResult, error)

type GenerateOptions

type GenerateOptions struct {
	RepositoryUrl        string
	RepositoryPath       string
	Region               string
	SearchCommitsOptions *SearchCommitsOptions
	CountLinesOption     *CountLinesOption
}

type GenerateResult

type GenerateResult struct {
	Repository  string                 `json:"repository"`
	Source      string                 `json:"source"`
	GeneratedAt time.Time              `json:"generatedAt"`
	Commits     []GenerateResultCommit `json:"commits"`
}

func Generate

func Generate(options *GenerateOptions) (*GenerateResult, error)

type GenerateResultCommit

type GenerateResultCommit struct {
	Hash        string                          `json:"hash"`
	CommittedAt time.Time                       `json:"committedAt"`
	LineCounts  []GenerateResultCommitLineCount `json:"lineCounts"`
}

type GenerateResultCommitLineCount

type GenerateResultCommitLineCount struct {
	FilterRegex string                                `json:"filterRegex"`
	FileCount   int                                   `json:"fileCount"`
	Areas       []GenerateResultCommitLineCountArea   `json:"areas"`
	Authors     []GenerateResultCommitLineCountAuthor `json:"authors"`
}

type GenerateResultCommitLineCountArea

type GenerateResultCommitLineCountArea struct {
	Name        string  `json:"name"`
	Size        float64 `json:"size"`
	Ratio       float64 `json:"ratio"`
	AuthorEmail string  `json:"authorEmail"`
	AuthorRank  int     `json:"authorRank"`
}

type GenerateResultCommitLineCountAuthor

type GenerateResultCommitLineCountAuthor struct {
	Email       string `json:"email"`
	Name        string `json:"name"`
	GitHubLogin string `json:"gitHubLogin"`
	LineCount   int    `json:"lineCount"`
	Rank        int    `json:"rank"`
}

type SearchCommitsOptions

type SearchCommitsOptions struct {
	Since    time.Time
	Until    time.Time
	Interval time.Duration
	Limit    int
}

Jump to

Keyboard shortcuts

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