git

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachingGitCloner

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

CachingGitCloner implements GitCloner with local caching

func NewCachingGitCloner

func NewCachingGitCloner(cacheDir string) *CachingGitCloner

NewCachingGitCloner creates a CachingGitCloner

func (*CachingGitCloner) Clone

func (c *CachingGitCloner) Clone(ctx context.Context, repoURL, branch string) (string, func(), error)

type Commit

type Commit struct {
	Hash      string
	Message   string
	Author    string
	Timestamp time.Time
}

Commit represents a git commit

type GitCloner

type GitCloner interface {
	Clone(ctx context.Context, repoURL, branch string) (repoPath string, cleanup func(), err error)
}

GitCloner defines the interface for cloning git repositories. Clone returns the path to the cloned repo and a cleanup function to call when done.

type Monitor

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

func NewMonitor

func NewMonitor(cfg *config.Config) *Monitor

func NewMonitorWithCache

func NewMonitorWithCache(repos []config.Repo, cacheEnabled bool, cacheDir string) *Monitor

NewMonitorWithCache creates a Monitor with optional caching based on config

func NewMonitorWithCloner

func NewMonitorWithCloner(repos []config.Repo, cloner GitCloner) *Monitor

NewMonitorWithCloner creates a Monitor with a custom GitCloner for testing

func NewMonitorWithRepos

func NewMonitorWithRepos(repos []config.Repo) *Monitor

func (*Monitor) GetRecentCommits

func (m *Monitor) GetRecentCommits(ctx context.Context) ([]RepoResult, error)

func (*Monitor) SetDays

func (m *Monitor) SetDays(days int)

type RealGitCloner

type RealGitCloner struct{}

RealGitCloner implements GitCloner using the git binary

func (*RealGitCloner) Clone

func (c *RealGitCloner) Clone(ctx context.Context, repoURL, branch string) (string, func(), error)

type RepoResult

type RepoResult struct {
	Repo    config.Repo
	Commits []Commit
	Error   error
}

RepoResult represents result for a single repository

Jump to

Keyboard shortcuts

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