Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatBytes ¶
FormatBytes formats bytes to human-readable string
func FormatCount ¶
FormatCount returns a formatted string for display
func FormatDate ¶
FormatDate formats a time.Time to the key format
Types ¶
type ContributionData ¶
type ContributionData struct {
Days map[string]int // "2024-01-15" -> 5 commits
TotalCommits int
WeeksCount int
StartDate time.Time
EndDate time.Time
MaxDaily int // Max commits in a single day (for scaling)
}
ContributionData holds commit counts per day for the heatmap
func GetContributions ¶
func GetContributions(repos []model.Repo, weeks int) (*ContributionData, error)
GetContributions aggregates commits from all repos for the last N weeks
func (*ContributionData) GetDayCount ¶
func (d *ContributionData) GetDayCount(date string) int
GetDayCount returns commit count for a specific date
func (*ContributionData) GetIntensityLevel ¶
func (d *ContributionData) GetIntensityLevel(date string) int
GetIntensityLevel returns 0-4 based on commit count relative to max
func (*ContributionData) GetMonthLabels ¶
func (d *ContributionData) GetMonthLabels() []string
GetMonthLabels returns month labels for the heatmap header
func (*ContributionData) GetWeeksData ¶
func (d *ContributionData) GetWeeksData() [][]string
GetWeeksData returns contribution data organized by weeks for rendering Returns a slice of weeks, each containing 7 days (Sun-Sat)
type DiskUsageData ¶
type DiskUsageData struct {
Repos []RepoDiskUsage
TotalGitSize int64
TotalNodeSize int64
TotalSize int64
MaxSize int64
RepoCount int
HasNodeModules bool
}
DiskUsageData holds disk usage information for all repos
func GetDiskUsage ¶
func GetDiskUsage(repos []model.Repo) (*DiskUsageData, error)
GetDiskUsage calculates .git and node_modules folder sizes for all repos
func (*DiskUsageData) GetBarWidth ¶
func (d *DiskUsageData) GetBarWidth(size int64, maxWidth int) int
GetBarWidth returns the relative bar width (0-100) for a repo size
type RepoDiskUsage ¶
type RepoDiskUsage struct {
Name string
Path string
GitSize int64 // Size of .git folder in bytes
NodeModulesSize int64 // Size of node_modules folder in bytes
TotalSize int64 // Combined size
}
RepoDiskUsage holds disk usage for a single repo
type TimelineData ¶
type TimelineData struct {
Entries []TimelineEntry
TotalRepos int
}
TimelineData holds timeline information
func GetTimeline ¶
func GetTimeline(repos []model.Repo) (*TimelineData, error)
GetTimeline gets recent activity timeline sorted by last commit