stats

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager handles repository statistics

func NewManager

func NewManager(cfg *config.Config) *Manager

NewManager creates a new stats manager

func (*Manager) Get

func (m *Manager) Get(ctx context.Context, repoName string) (*Stats, error)

Get returns repository statistics

func (*Manager) GetStarHistory

func (m *Manager) GetStarHistory(ctx context.Context, repoName string, days int) ([]StarHistory, error)

GetStarHistory returns star history for the specified number of days

type StarHistory

type StarHistory struct {
	Date  time.Time `json:"date"`
	Stars int       `json:"stars"`
}

StarHistory represents star count at a specific date

type Stats

type Stats struct {
	Stars       int    `json:"stars"`
	Forks       int    `json:"forks"`
	OpenIssues  int    `json:"open_issues"`
	LastUpdated string `json:"last_updated"`
}

Stats represents repository statistics

Jump to

Keyboard shortcuts

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