Documentation
¶
Index ¶
- type Client
- func (c *Client) FilterTagsWithPrefix(tags []*github.RepositoryTag, prefix string) []*github.RepositoryTag
- func (c *Client) GetCommitForTag(ctx context.Context, owner, repo, tag string) (string, error)
- func (c *Client) GetCommitInfo(ctx context.Context, owner, repo, sha string) (*github.Commit, error)
- func (c *Client) GetFirstValidRelease(ctx context.Context, owner, repo string, tagPrefix, tagContains string, ...) (string, error)
- func (c *Client) GetFirstValidTag(ctx context.Context, owner, repo string, tagPrefix, tagContains string, ...) (string, error)
- func (c *Client) GetLatestRelease(ctx context.Context, owner, repo string) (*github.RepositoryRelease, error)
- func (c *Client) GetReleases(ctx context.Context, owner, repo string) ([]*github.RepositoryRelease, error)
- func (c *Client) GetReleasesPage(ctx context.Context, owner, repo string, page, perPage int) ([]*github.RepositoryRelease, *github.Response, error)
- func (c *Client) GetRepositoryCommit(ctx context.Context, owner, repo, sha string) (*github.RepositoryCommit, error)
- func (c *Client) GetTags(ctx context.Context, owner, repo string) ([]*github.RepositoryTag, error)
- func (c *Client) GetTagsPage(ctx context.Context, owner, repo string, page, perPage int) ([]*github.RepositoryTag, *github.Response, error)
- func (c *Client) ListReleasesByTag(ctx context.Context, owner, repo, tagPattern string) ([]*github.RepositoryRelease, error)
- func (c *Client) VerifyRepository(ctx context.Context, owner, repo string) error
- type Repository
- type Searcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a client for the GitHub API using go-github
func New ¶
New creates a new GitHub client with optional authentication If httpClient is nil, a default HTTP client will be used If authentication is configured via GITHUB_TOKEN, the client will be wrapped with oauth2
func (*Client) FilterTagsWithPrefix ¶
func (c *Client) FilterTagsWithPrefix(tags []*github.RepositoryTag, prefix string) []*github.RepositoryTag
FilterTagsWithPrefix filters tags that start with a specific prefix
func (*Client) GetCommitForTag ¶
GetCommitForTag gets the commit SHA for a specific tag
func (*Client) GetCommitInfo ¶
func (c *Client) GetCommitInfo(ctx context.Context, owner, repo, sha string) (*github.Commit, error)
GetCommitInfo gets detailed information about a commit
func (*Client) GetFirstValidRelease ¶
func (c *Client) GetFirstValidRelease(ctx context.Context, owner, repo string, tagPrefix, tagContains string, filter types.VersionFilterFunc) (string, error)
GetFirstValidRelease finds the first release that passes all filtering criteria
func (*Client) GetFirstValidTag ¶
func (c *Client) GetFirstValidTag(ctx context.Context, owner, repo string, tagPrefix, tagContains string, filter types.VersionFilterFunc) (string, error)
GetFirstValidTag finds the first tag that passes all filtering criteria
func (*Client) GetLatestRelease ¶
func (c *Client) GetLatestRelease(ctx context.Context, owner, repo string) (*github.RepositoryRelease, error)
GetLatestRelease fetches the latest release for a repository
func (*Client) GetReleases ¶
func (c *Client) GetReleases(ctx context.Context, owner, repo string) ([]*github.RepositoryRelease, error)
GetReleases fetches releases for a repository
func (*Client) GetReleasesPage ¶
func (c *Client) GetReleasesPage(ctx context.Context, owner, repo string, page, perPage int) ([]*github.RepositoryRelease, *github.Response, error)
GetReleasesPage fetches a specific page of releases (useful for pagination)
func (*Client) GetRepositoryCommit ¶
func (c *Client) GetRepositoryCommit(ctx context.Context, owner, repo, sha string) (*github.RepositoryCommit, error)
GetRepositoryCommit gets a repository commit (different from Git commit)
func (*Client) GetTagsPage ¶
func (c *Client) GetTagsPage(ctx context.Context, owner, repo string, page, perPage int) ([]*github.RepositoryTag, *github.Response, error)
GetTagsPage fetches a specific page of tags (useful for pagination)
func (*Client) ListReleasesByTag ¶
func (c *Client) ListReleasesByTag(ctx context.Context, owner, repo, tagPattern string) ([]*github.RepositoryRelease, error)
ListReleasesByTag gets releases that match a specific tag pattern
type Repository ¶
Repository represents basic repository information
func ParseRepository ¶
func ParseRepository(identifier string) (*Repository, error)
ParseRepository parses a repository identifier like "golang/go" into owner and repo
type Searcher ¶ added in v0.3.0
type Searcher struct {
// contains filtered or unexported fields
}
Searcher adapts CHOAM's GitHub access to omnibump's remote.GitHubSearcher interface (GetFileContent + ListFilePaths), so that omnibump's remote fetcher can retrieve go.mod/go.sum files without checking out the repository.
GetFileContent prefers the unauthenticated raw.githubusercontent.com fast path (which avoids consuming GitHub API rate limit for public repositories) and falls back to the authenticated Contents API for private repositories.
func NewSearcher ¶ added in v0.3.0
NewSearcher creates a Searcher. The provided httpClient is used both to build the (optionally token-authenticated) go-github client and for raw content fetches; if nil, http.DefaultClient is used for raw fetches.
func (*Searcher) GetFileContent ¶ added in v0.3.0
func (s *Searcher) GetFileContent(ctx context.Context, owner, repo, path, ref string) ([]byte, error)
GetFileContent fetches the content of a file at a specific ref, trying the raw content host first and falling back to the authenticated Contents API.
func (*Searcher) ListFilePaths ¶ added in v0.3.0
ListFilePaths returns all blob paths in a repository at the given ref using the Git Tree API. It is provided to satisfy the remote.GitHubSearcher interface; CHOAM fetches known modroots directly and does not rely on it.