{"modulePath":"github.com/Stackdome/stackdome","version":"v0.0.7-alpha","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package git\n\n## Variables\n\n```go\nvar (\n\tErrNotFound    = errors.New(\"not found\")\n\tErrAuthFailed  = errors.New(\"authentication failed\")\n\tErrRateLimited = errors.New(\"rate limited\")\n)\n```\n\n## Functions\n\n```go\nfunc IsGithubHost(host string) bool\n```\n\n```go\nfunc IsGithubRepo(repoURL string) bool\n```\nIsGithubRepo returns true for gh repos\n\n```go\nfunc ParseGitHubRepoURL(repoURL string) (owner, repo string, ok bool)\n```\nParseGitHubRepoURL extracts owner and repo from a GitHub URL. Handles HTTPS, SSH, and SCP-style URLs (git@github.com:owner/repo.git). Returns false if the URL is not a GitHub repo.\n\n```go\nfunc RepoHost(repoURL string) string\n```\nRepoHost extracts the host (without port) from any git repository URL — https, ssh://, or scp-style (git@host:org/repo) — falling back to the raw URL when it cannot be parsed.\n\n```go\nfunc ResolveGitRepoRevision(ctx context.Context, client GitClient, repoURL string, rev models.GitRepoRevision) (models.GitRepoRevision, error)\n```\nResolveGitRepoRevision ensures the revision has a resolved commit SHA. If Commit is already set, it returns as-is. Otherwise it resolves the branch HEAD or tag SHA using the provided git client.\n\n## Types\n\n```go\ntype GitClient interface {\n\tCheckAccess(ctx context.Context, repoURL string) (bool, error)\n\tGetTagSHA(ctx context.Context, repoURL, tag string) (string, error)\n\tCheckTagExists(ctx context.Context, repoURL, tag string) (bool, error)\n\tGetBranchHeadSHA(ctx context.Context, repoURL, branch string) (*RepoResult, error)\n\tGetDefaultBranch(ctx context.Context, repoURL string) (string, error)\n\tFetchFile(ctx context.Context, repoURL, ref, filePath string) ([]byte, error)\n}\n```\n\n```go\nfunc NewGitClientForRepo(repoURL string, creds GitCredentials) (GitClient, error)\n```\nNewGitClientForRepo returns a GitClient backed by the GitHub REST API for github.com repos, or the generic go-git client for all other hosts.\n\n```go\ntype GitCredentials struct {\n\tToken    string\n\tUsername string\n\tPassword string\n}\n```\nGitCredentials holds optional git authentication material. A zero value selects anonymous access.\n\n```go\ntype RepoResult struct {\n\tHeadSHA string\n\tBranch  string\n}\n```\n\n","path":"github.com/Stackdome/stackdome/pkg/clients/git","name":"git","synopsis":"","isRedistributable":true}
