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) CodeSearch(repo api_results.GHRepo, tokens []string, config *config.AppConfig) (*api_results.CodeScanResults, error)
- func (ghClient *GHClient) GetLanguages(languagesUrl string) ([]api_results.GHLanguage, error)
- func (ghClient *GHClient) GetRepoData(repoScanResults api_results.RepoScanResult, owner string, ...) (*api_results.GHRepo, error)
- func (ghClient *GHClient) GetReposForOrg(config *config.AppConfig) (api_results.GHRepos, error)
- func (ghClient *GHClient) GetTeams(teamsUrl string, teamsToIgnore config.TeamsToIgnore) (string, error)
- func (ghClient *GHClient) ScanPackageDeps(config *config.AppConfig) (api_results.RepoScanResults, error)
- func (ghClient *GHClient) SearchReposByLanguage(config *config.AppConfig) (api_results.GHRepos, error)
- func (ghClient *GHClient) SearchReposByLanguages(config *config.AppConfig, listOptions *github.ListOptions) ([]api_results.GHRepo, *github.Response, 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) CodeSearch ¶
func (ghClient *GHClient) CodeSearch(repo api_results.GHRepo, tokens []string, config *config.AppConfig) (*api_results.CodeScanResults, error)
Calls the GitHub search API looking for the set of tokens provided.
func (*GHClient) GetLanguages ¶
func (ghClient *GHClient) GetLanguages(languagesUrl string) ([]api_results.GHLanguage, error)
GitHub Languages Request
There is not a provided method for retrieving the list of language for a repository in the Go GitHub API.
Create and call the request using the provided teams URL
func (*GHClient) GetRepoData ¶
func (ghClient *GHClient) GetRepoData( repoScanResults api_results.RepoScanResult, owner string, teamsToIgnore config.TeamsToIgnore) (*api_results.GHRepo, error)
Retrieves the repository data for the provided dependency scan results
func (*GHClient) GetReposForOrg ¶
Get the organization's repositories for the provided config values
Config values of interest - PerPage - Owner
func (*GHClient) GetTeams ¶
func (ghClient *GHClient) GetTeams(teamsUrl string, teamsToIgnore config.TeamsToIgnore) (string, error)
GitHub Teams Request
There is not a provided method for retrieving the list of teams for a repository in the Go GitHub API
Create and call the request using the provided teams URL
func (*GHClient) ScanPackageDeps ¶
func (ghClient *GHClient) ScanPackageDeps(config *config.AppConfig) (api_results.RepoScanResults, error)
Initiates a code search that looks for the instance of the dependecies defined
in the application configuration. It then returns a slice of RepoScanResult
containing the repository, location and version of the dependency that was searched.
func (*GHClient) SearchReposByLanguage ¶
func (*GHClient) SearchReposByLanguages ¶
func (ghClient *GHClient) SearchReposByLanguages(config *config.AppConfig, listOptions *github.ListOptions) ([]api_results.GHRepo, *github.Response, error)