Documentation
¶
Index ¶
- func CreateAuthenticatedURL(repoURL, token string) (string, error)
- func ExtractHostname(githubURL string) string
- func ExtractRepositoryHostname(url string) string
- func GetAPIBase() string
- func GetGitHubURL() string
- func GetRepositoryFromGitRemote() string
- func ParseRepositoryURL(url string) string
- type InstallationCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAuthenticatedURL ¶ added in v1.70.0
CreateAuthenticatedURL creates an authenticated GitHub URL with token
func ExtractHostname ¶ added in v1.70.0
ExtractHostname extracts hostname from GitHub URL
func ExtractRepositoryHostname ¶ added in v1.309.0
ExtractRepositoryHostname extracts the hostname from a Git repository URL. Handles SSH (git@hostname:path), HTTPS, HTTP, and git:// formats. Examples:
"https://github.com/owner/repo.git" → "github.com" "git@github.enterprise.com:owner/repo.git" → "github.enterprise.com" "http://github.com/owner/repo" → "github.com"
func GetAPIBase ¶ added in v1.70.0
func GetAPIBase() string
GetAPIBase returns the GitHub API base URL (supports enterprise)
func GetGitHubURL ¶ added in v1.70.0
func GetGitHubURL() string
GetGitHubURL returns the GitHub URL (supports enterprise)
func GetRepositoryFromGitRemote ¶ added in v1.70.0
func GetRepositoryFromGitRemote() string
GetRepositoryFromGitRemote extracts repository full name from git remote
func ParseRepositoryURL ¶ added in v1.70.0
ParseRepositoryURL extracts owner/repo from various Git URL formats
Types ¶
type InstallationCache ¶
type InstallationCache struct {
// contains filtered or unexported fields
}
InstallationCache provides caching for GitHub App installation IDs
func NewInstallationCache ¶
func NewInstallationCache() *InstallationCache
NewInstallationCache creates a new installation ID cache with 24-hour TTL
func NewInstallationCacheWithTTL ¶
func NewInstallationCacheWithTTL(ttl time.Duration) *InstallationCache
NewInstallationCacheWithTTL creates a new installation ID cache with custom TTL
func (*InstallationCache) ClearCache ¶
func (c *InstallationCache) ClearCache()
ClearCache clears all cached entries
func (*InstallationCache) GetCacheStats ¶
func (c *InstallationCache) GetCacheStats() (repoCount, orgCount int)
GetCacheStats returns cache statistics for debugging
func (*InstallationCache) GetInstallationID ¶
func (c *InstallationCache) GetInstallationID(ctx context.Context, appID int64, pemData []byte, repoFullName, apiBase string) (int64, error)
GetInstallationID retrieves installation ID for a repository with caching