Documentation
¶
Index ¶
- func GetPagedResults[T any](config *config.AppConfig, options *github.ListOptions, ...) ([]T, error)
- func WaitForRateLimit(err error, resp *github.Response) bool
- type GHClient
- func (ghClient *GHClient) DiscoverComponentTokens(owner string, repos []string, extractDir string, authToken string) ([]string, error)
- func (ghClient *GHClient) DiscoverComponentTokensFromMonorepo(owner, repoName string, paths []string, extractDir, authToken string) ([]string, error)
- func (ghClient *GHClient) GetLanguages(languagesUrl string) ([]api_results.GHLanguage, error)
- func (ghClient *GHClient) GetRepoData(sr api_results.RepoScanResult) (*api_results.GHRepo, error)
- func (ghClient *GHClient) ScanPackageDeps(config *config.AppConfig) (api_results.RepoScanResults, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPagedResults ¶
func GetPagedResults[T any]( config *config.AppConfig, options *github.ListOptions, operation func(config *config.AppConfig, options *github.ListOptions) ([]T, *github.Response, error)) ([]T, error)
GetPagedResults handles executing the provide API method until all results are retrieved. The number of results per page is determined the github.ListOptions.
Types ¶
type GHClient ¶
GHClient struct - contains the context and a pointer to a github.Client that will be used to execute GitHub API methods
func (*GHClient) DiscoverComponentTokens ¶
func (ghClient *GHClient) DiscoverComponentTokens( owner string, repos []string, extractDir string, authToken string, ) ([]string, error)
DiscoverComponentTokens downloads each source repo concurrently, extracts component identifiers from its source files, and returns a deduplicated token list. Supports Angular (selector values), React (exported PascalCase names), and Vue (component name values) source repos.
func (*GHClient) DiscoverComponentTokensFromMonorepo ¶
func (ghClient *GHClient) DiscoverComponentTokensFromMonorepo( owner, repoName string, paths []string, extractDir, authToken string, ) ([]string, error)
DiscoverComponentTokensFromMonorepo downloads a single monorepo and extracts component tokens from each workspace path. If paths is empty the entire repo is scanned.
func (*GHClient) GetLanguages ¶
func (ghClient *GHClient) GetLanguages(languagesUrl string) ([]api_results.GHLanguage, error)
func (*GHClient) GetRepoData ¶
func (ghClient *GHClient) GetRepoData(sr api_results.RepoScanResult) (*api_results.GHRepo, error)
GetRepoData fetches metadata for a single repo identified by the scan result.
func (*GHClient) ScanPackageDeps ¶
func (ghClient *GHClient) ScanPackageDeps(config *config.AppConfig) (api_results.RepoScanResults, error)
ScanPackageDeps searches all public GitHub repos for package.json files that reference any of the configured dependencies and returns the matching repos with their declared versions.