Documentation
¶
Overview ¶
Package github implements the GitHub Security Advisories provider.
Index ¶
Constants ¶
View Source
const ( ProviderName = "github" SchemaName = "github" SchemaVersion = "1" Version = 2 DefaultAdvisoriesPerPage = 100 DefaultWorkers = 1 // GitHub is cursor-based (sequential), workers don't help DefaultTimeout = 2 * time.Minute // GitHub GraphQL rate limits: // - Primary: 5000 points per hour // - Secondary: 2000 points per MINUTE (more restrictive!) // Use conservative limit to stay under secondary (2000/min) RateLimit = 1500 // Conservative (allows ~90 points/query) RateLimitWindow = time.Minute // API endpoint APIURL = "https://api.github.com/graphql" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GraphQLClient ¶
type GraphQLClient struct {
// contains filtered or unexported fields
}
GraphQLClient handles GitHub GraphQL API requests.
func NewGraphQLClient ¶
func NewGraphQLClient(token string, limiter *ratelimit.Limiter, pageSize int, timeout time.Duration, debug bool) *GraphQLClient
NewGraphQLClient creates a new GitHub GraphQL client.
func (*GraphQLClient) FetchAll ¶
func (c *GraphQLClient) FetchAll(ctx context.Context, updatedSince *time.Time, writer *store.SQLiteWriter) error
FetchAll fetches all security advisories, optionally filtered by updatedSince.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements the GitHub Security Advisories provider.
func NewProvider ¶
func NewProvider(cfg provider.GitHubConfig) (*Provider, error)
NewProvider creates a new GitHub provider.
func (*Provider) FetchAll ¶
FetchAll downloads all security advisories. GitHub uses cursor-based pagination, so this is sequential but fast.
func (*Provider) FetchIncremental ¶
FetchIncremental downloads only advisories updated since lastUpdated.
func (*Provider) MetadataPath ¶
MetadataPath returns the path to metadata.json.
func (*Provider) ResultsPath ¶
ResultsPath returns the path to the SQLite database.
Click to show internal directories.
Click to hide internal directories.