Documentation
¶
Overview ¶
internal/provider/bitbucket.go
internal/provider/github.go
internal/provider/gitlab.go
internal/provider/provider.go
Index ¶
- type Bitbucket
- func (b *Bitbucket) CommitFileStats(ctx context.Context, repo model.Repo, hash string) ([]FileChange, error)
- func (b *Bitbucket) CommitStats(ctx context.Context, repo model.Repo, hash string) (int64, int64, error)
- func (b *Bitbucket) ListCommits(ctx context.Context, repo model.Repo, limit int) ([]CommitInfo, error)
- func (b *Bitbucket) ListProjects(ctx context.Context, workspace string) ([]Project, error)
- func (b *Bitbucket) ListRepos(ctx context.Context, opts ListOpts) ([]model.Repo, error)
- type ChurnLister
- type CommitInfo
- type CommitLister
- type FileChange
- type GitHub
- func (g *GitHub) CommitFileStats(ctx context.Context, repo model.Repo, hash string) ([]FileChange, error)
- func (g *GitHub) CommitStats(ctx context.Context, repo model.Repo, hash string) (int64, int64, error)
- func (g *GitHub) ListCommits(ctx context.Context, repo model.Repo, limit int) ([]CommitInfo, error)
- func (g *GitHub) ListRepos(ctx context.Context, opts ListOpts) ([]model.Repo, error)
- type GitLab
- func (g *GitLab) CommitStats(ctx context.Context, repo model.Repo, hash string) (int64, int64, error)
- func (g *GitLab) ListCommits(ctx context.Context, repo model.Repo, limit int) ([]CommitInfo, error)
- func (g *GitLab) ListRepos(ctx context.Context, opts ListOpts) ([]model.Repo, error)
- func (g *GitLab) ListSubgroups(ctx context.Context, group string) ([]Subgroup, error)
- type ListOpts
- type Project
- type Provider
- type RateLimitTransport
- type Subgroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bitbucket ¶
type Bitbucket struct {
// contains filtered or unexported fields
}
Bitbucket implements Provider for Bitbucket Cloud.
func NewBitbucket ¶
NewBitbucket creates a new Bitbucket provider. If baseURL is empty, the default Bitbucket Cloud API endpoint is used. If username is non-empty, Basic Auth is used instead of Bearer token auth.
func (*Bitbucket) CommitFileStats ¶ added in v0.8.0
func (b *Bitbucket) CommitFileStats(ctx context.Context, repo model.Repo, hash string) ([]FileChange, error)
CommitFileStats fetches per-file addition/deletion counts for a single Bitbucket commit.
func (*Bitbucket) CommitStats ¶ added in v0.7.0
func (b *Bitbucket) CommitStats(ctx context.Context, repo model.Repo, hash string) (int64, int64, error)
CommitStats fetches addition/deletion counts for a single Bitbucket commit.
func (*Bitbucket) ListCommits ¶ added in v0.7.0
func (b *Bitbucket) ListCommits(ctx context.Context, repo model.Repo, limit int) ([]CommitInfo, error)
ListCommits fetches up to limit commits for a repo via the Bitbucket API.
func (*Bitbucket) ListProjects ¶ added in v0.2.0
ListProjects fetches all projects in a Bitbucket workspace, handling pagination automatically.
type ChurnLister ¶ added in v0.8.0
type ChurnLister interface {
CommitLister
CommitFileStats(ctx context.Context, repo model.Repo, hash string) ([]FileChange, error)
}
ChurnLister extends Provider with per-file commit stats.
type CommitInfo ¶ added in v0.7.0
CommitInfo represents a commit returned from a provider API.
type CommitLister ¶ added in v0.7.0
type CommitLister interface {
ListCommits(ctx context.Context, repo model.Repo, limit int) ([]CommitInfo, error)
CommitStats(ctx context.Context, repo model.Repo, hash string) (additions, deletions int64, err error)
}
CommitLister extends Provider with commit history capabilities.
type FileChange ¶ added in v0.8.0
FileChange represents a file modified in a commit.
type GitHub ¶
type GitHub struct {
// contains filtered or unexported fields
}
GitHub implements Provider for GitHub.
func NewGitHub ¶
NewGitHub creates a new GitHub provider. If baseURL is empty, the default GitHub API endpoint is used.
func (*GitHub) CommitFileStats ¶ added in v0.8.0
func (g *GitHub) CommitFileStats(ctx context.Context, repo model.Repo, hash string) ([]FileChange, error)
CommitFileStats fetches per-file addition/deletion counts for a single commit.
func (*GitHub) CommitStats ¶ added in v0.7.0
func (g *GitHub) CommitStats(ctx context.Context, repo model.Repo, hash string) (int64, int64, error)
CommitStats fetches addition/deletion counts for a single commit.
func (*GitHub) ListCommits ¶ added in v0.7.0
ListCommits fetches up to limit commits for a repo via the GitHub API.
type GitLab ¶ added in v0.8.0
type GitLab struct {
// contains filtered or unexported fields
}
GitLab implements Provider and CommitLister for GitLab.
func NewGitLab ¶ added in v0.8.0
NewGitLab creates a new GitLab provider. If baseURL is empty, the default GitLab.com endpoint is used.
func (*GitLab) CommitStats ¶ added in v0.8.0
func (g *GitLab) CommitStats(ctx context.Context, repo model.Repo, hash string) (int64, int64, error)
CommitStats fetches addition/deletion counts for a single GitLab commit.
func (*GitLab) ListCommits ¶ added in v0.8.0
ListCommits fetches up to limit commits for a repo via the GitLab API.
type ListOpts ¶
type ListOpts struct {
Workspace string
Organization string
User string
Projects []string
Repos []string
Exclude []string
IncludeArchived bool
IncludeForks bool
}
ListOpts configures which repositories to retrieve from a provider.
type Provider ¶
Provider is the interface that Bitbucket, GitHub, and GitLab implement for listing repositories.
type RateLimitTransport ¶ added in v0.8.1
type RateLimitTransport struct {
ReqPerSec float64 // 0 = unlimited (retry-only)
Base http.RoundTripper // nil = http.DefaultTransport
// contains filtered or unexported fields
}
RateLimitTransport wraps an http.RoundTripper with rate limiting and 429 retry.