Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var GithubAPIBaseURL = "https://api.github.com"
GithubAPIBaseURL allows overriding for tests. It is an exported variable.
var GithubAPIBaseURLMutex sync.Mutex // Mutex for GithubAPIBaseURL (Exported)
var TestModeBypassHostValidationMutex sync.Mutex // Mutex for testModeBypassHostValidation (Exported)
Functions ¶
func GetLatestCommitSHAForFile ¶
GetLatestCommitSHAForFile fetches the latest commit SHA for a specific file on a given branch/ref from GitHub. owner: repository owner repo: repository name pathInRepo: path to the file within the repository ref: branch name, tag name, or commit SHA
func SetTestModeBypassHostValidation ¶
func SetTestModeBypassHostValidation(enable bool)
SetTestModeBypassHostValidation enables or disables the hostname validation bypass for testing. This function is intended to be called only from test packages.
Types ¶
type GitHubCommitInfo ¶
type GitHubCommitInfo struct {
SHA string `json:"sha"`
Commit struct {
Committer struct {
Date time.Time `json:"date"`
} `json:"committer"`
} `json:"commit"`
}
GitHubCommitInfo minimal structure to parse the commit SHA.
type ParsedSourceInfo ¶
type ParsedSourceInfo struct {
RawURL string
CanonicalURL string
Ref string
Provider string
Owner string
Repo string
PathInRepo string
SuggestedFilename string
}
ParsedSourceInfo holds the details extracted from a source URL.
func ParseSourceURL ¶
func ParseSourceURL(sourceURL string) (*ParsedSourceInfo, error)
ParseSourceURL analyzes the input source URL string and returns structured information. It currently prioritizes GitHub URLs.