github

package
v0.0.0-...-4dfa885 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

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

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

func (g *GithubSourceRepository) ListBranches(ctx context.Context) ([]*github.Branch, error)

ListBranches fetches all branches for the repository, handling pagination.

Jump to

Keyboard shortcuts

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