github

package
v1.80.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAuthenticatedURL added in v1.70.0

func CreateAuthenticatedURL(repoURL, token string) (string, error)

CreateAuthenticatedURL creates an authenticated GitHub URL with token

func ExtractHostname added in v1.70.0

func ExtractHostname(githubURL string) string

ExtractHostname extracts hostname from GitHub URL

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

func ParseRepositoryURL(url string) string

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

Jump to

Keyboard shortcuts

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