Documentation
¶
Index ¶
- func NewGithubSourceRepository(client *github.Client, owner string, gitRepo string) domain.SourceRepository
- type GithubSourceRepository
- func (g *GithubSourceRepository) GetCommit(ctx context.Context, sha string) (*github.RepositoryCommit, error)
- func (g *GithubSourceRepository) GetCommitsInRange(ctx context.Context, baseCommit string, headCommit string) ([]*github.RepositoryCommit, error)
- func (g *GithubSourceRepository) GetCommitsSince(ctx context.Context, branchName string, since time.Time) ([]*github.RepositoryCommit, error)
- func (g *GithubSourceRepository) GetDefaultBranchName(ctx context.Context) (string, error)
- func (g *GithubSourceRepository) GetFileContents(ctx context.Context, path string, ref string) ([]byte, error)
- func (g *GithubSourceRepository) GetRepoFullName() string
- func (g *GithubSourceRepository) ListBranches(ctx context.Context) ([]*github.Branch, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGithubSourceRepository ¶
func NewGithubSourceRepository(client *github.Client, owner string, gitRepo string) domain.SourceRepository
NewGithubSourceRepository creates a new GithubSourceRepository.
Types ¶
type GithubSourceRepository ¶
type GithubSourceRepository struct {
// contains filtered or unexported fields
}
GithubSourceRepository is an implementation of domain.SourceRepository that uses the GitHub API.
func (*GithubSourceRepository) GetCommit ¶
func (g *GithubSourceRepository) GetCommit(ctx context.Context, sha string) (*github.RepositoryCommit, error)
GetCommit fetches a single commit by its SHA.
func (*GithubSourceRepository) GetCommitsInRange ¶
func (g *GithubSourceRepository) GetCommitsInRange(ctx context.Context, baseCommit string, headCommit string) ([]*github.RepositoryCommit, error)
GetCommitsInRange fetches commits between baseCommit and headCommit (inclusive). This is useful for processing all commits in a push event.
func (*GithubSourceRepository) GetCommitsSince ¶
func (g *GithubSourceRepository) GetCommitsSince(ctx context.Context, branchName string, since time.Time) ([]*github.RepositoryCommit, error)
GetCommitsSince fetches commits for a branch since a given time.
func (*GithubSourceRepository) GetDefaultBranchName ¶
func (g *GithubSourceRepository) GetDefaultBranchName(ctx context.Context) (string, error)
GetDefaultBranchName fetches the repository metadata and returns the name of the default branch.
func (*GithubSourceRepository) GetFileContents ¶
func (g *GithubSourceRepository) GetFileContents(ctx context.Context, path string, ref string) ([]byte, error)
GetFileContents fetches the contents of a file at a specific ref (branch, tag, or commit SHA).
func (*GithubSourceRepository) GetRepoFullName ¶
func (g *GithubSourceRepository) GetRepoFullName() string
GetRepoFullName returns the repository's full name (e.g., "owner/repo").
func (*GithubSourceRepository) ListBranches ¶
ListBranches fetches all branches for the repository, handling pagination.