github_api

package
v0.0.0-...-8297970 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

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.

func WaitForRateLimit

func WaitForRateLimit(err error, resp *github.Response) bool

Waits for the GitHub API rate limit to be reset.

Types

type GHClient

type GHClient struct {
	Client *github.Client
	Ctx    context.Context
}

GHClient struct - contains the context and a pointer to a github.Client that will be used to execute GitHub API methods

func NewClient

func NewClient(token string) *GHClient

Creates a new GitHub Client

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.

Jump to

Keyboard shortcuts

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