cmd

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayAuthorInfo added in v1.6.3

func DisplayAuthorInfo(targetAuthor string)

DisplayAuthorInfo shows detailed information about the specified author or the configured author

func DisplayHistory added in v1.6.3

func DisplayHistory(opts HistoryOptions)

DisplayHistory is the main entry point for the history command

func DisplayStats

func DisplayStats(targetRepo string)

DisplayStats - Displays stats for all active repositories or a specific repository

func Execute added in v1.6.0

func Execute()

Execute adds all child commands to the root command and sets flags appropriately.

Types

type AuthorStats added in v1.6.3

type AuthorStats struct {
	Name            string
	Email           string
	TotalCommits    int
	CurrentStreak   int
	LongestStreak   int
	WeeklyCommits   int
	MonthlyCommits  int
	TotalAdditions  int
	TotalDeletions  int
	TopRepositories []RepoActivity
	PeakHour        int
	PeakCommits     int
	Languages       map[string]int
}

type CommitSummary added in v1.6.3

type CommitSummary struct {
	Hash            string
	Date            time.Time
	Message         string
	FileCount       int
	Additions       int
	Deletions       int
	TotalLines      int
	FilesChanged    []string
	Branch          string
	Repository      string
	Author          string
	MatchingContent []string // Added to store matching content
}

type CommitTrend added in v1.5.4

type CommitTrend struct {
	// contains filtered or unexported fields
}

type DefaultRepoCache added in v1.5.9

type DefaultRepoCache struct {
	// contains filtered or unexported fields
}

DefaultRepoCache implements RepoCache

func (*DefaultRepoCache) GetRepos added in v1.5.9

func (rc *DefaultRepoCache) GetRepos() map[string]scan.RepoMetadata

type DefaultStatsCalculator added in v1.5.9

type DefaultStatsCalculator struct{}

DefaultStatsCalculator implements StatsCalculator

func (*DefaultStatsCalculator) CalculateCommitTrend added in v1.5.9

func (c *DefaultStatsCalculator) CalculateCommitTrend(current int, previous int) CommitTrend

func (*DefaultStatsCalculator) CalculateTableWidth added in v1.5.9

func (c *DefaultStatsCalculator) CalculateTableWidth() int

func (*DefaultStatsCalculator) ProcessLanguageStats added in v1.5.9

func (c *DefaultStatsCalculator) ProcessLanguageStats(cache map[string]scan.RepoMetadata) map[string]int

type FileResult added in v1.6.3

type FileResult struct {
	Path         string
	Content      string
	LastModified time.Time
}

FileResult represents a file and its content

type HistoryOptions added in v1.6.3

type HistoryOptions struct {
	Author      string
	Repository  string
	Days        int
	Detailed    bool
	Interactive bool
	Preview     bool
	Format      string
	Branch      string
	Query       string // Search query for filtering commits
}

type HourStats added in v1.5.4

type HourStats map[int]int

type LanguageStats added in v1.5.4

type LanguageStats map[string]int

type RepoActivity added in v1.6.3

type RepoActivity struct {
	Name       string
	Commits    int
	LastCommit time.Time
	Additions  int
	Deletions  int
	IsStarred  bool
	StarCount  int
}

type RepoCache added in v1.5.9

type RepoCache interface {
	GetRepos() map[string]scan.RepoMetadata
}

RepoCache represents the interface for accessing repository data

type StatsCalculator added in v1.5.9

type StatsCalculator interface {
	CalculateCommitTrend(current, previous int) CommitTrend
	ProcessLanguageStats(cache map[string]scan.RepoMetadata) map[string]int
	CalculateTableWidth() int
}

StatsCalculator handles the calculation logic for repository statistics

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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