github

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StarsService

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

StarsService implements ports.GitHubService for fetching GitHub repository stars.

func NewStarsService

func NewStarsService(token string) *StarsService

NewStarsService creates a new StarsService. token is optional - if empty, uses unauthenticated API (60 req/h limit).

func (*StarsService) GetStars

func (s *StarsService) GetStars(ctx context.Context, repoURL domain.GitHubURL) (int, error)

GetStars fetches the current star count for a GitHub repository. Uses cache if available and not expired (1 hour TTL). Returns 0 if the repository doesn't exist or on error (fail-safe).

func (*StarsService) StartCleanup

func (s *StarsService) StartCleanup(ctx context.Context)

StartCleanup starts a background goroutine to periodically clean up expired cache entries.

Jump to

Keyboard shortcuts

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