stats

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 8 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 manages repository statistics

func NewManager

func NewManager() (*Manager, error)

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 StarEvent added in v0.1.12

type StarEvent struct {
	Type      string    `json:"type"`
	CreatedAt time.Time `json:"created_at"`
}

StarEvent represents a GitHub star event

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