Documentation
¶
Index ¶
- Variables
- func EndpointURL(base *url.URL, segments ...string) string
- func NewHTTPClient(caPEM []byte, endpoints Endpoints, timeout time.Duration) (*http.Client, error)
- func SetAPIHeaders(header http.Header, apiVersion string)
- type Client
- func (c *Client) DefaultBranchSHA(ctx context.Context, installationID int64, owner, name, branch string) (string, error)
- func (c *Client) DependencySBOM(ctx context.Context, installationID int64, owner, name string) (SBOM, bool, error)
- func (c *Client) DependencySBOMDocument(ctx context.Context, installationID int64, owner, name string, maxBytes int64) (SBOMDocument, error)
- func (c *Client) DownloadArchive(ctx context.Context, owner, repository, sha, token string) (io.ReadCloser, error)
- func (c *Client) InstallationRepositories(ctx context.Context, installationID int64) ([]Repository, error)
- func (c *Client) InstallationToken(ctx context.Context, installationID int64, repositoryIDs []int64) (Token, error)
- func (c *Client) Installations(ctx context.Context) ([]Installation, error)
- func (c *Client) ReadContents(ctx context.Context, installationID int64, owner, name, path, ref string, ...) (Content, error)
- func (c *Client) SearchCode(ctx context.Context, installationID int64, query string, repositoryIDs []int64) (api.SearchResponse, error)
- type Content
- type Endpoints
- type HTTPStatusError
- type Installation
- type RateLimit
- type ReconcileAPI
- type ReconcileStore
- type Reconciler
- type Repository
- type SBOM
- type SBOMDocument
- type SBOMError
- type SBOMPackage
- type SBOMRelationship
- type Signer
- type Token
Constants ¶
This section is empty.
Variables ¶
var ErrSBOMMalformed = errors.New("GitHub SBOM export envelope is malformed")
var ErrSBOMTooLarge = errors.New("GitHub SBOM export exceeds the configured limit")
var ErrUnconfiguredHost = errors.New("GitHub request host is not configured")
Functions ¶
func NewHTTPClient ¶
func SetAPIHeaders ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DefaultBranchSHA ¶
func (*Client) DependencySBOM ¶
func (c *Client) DependencySBOM(ctx context.Context, installationID int64, owner, name string) (SBOM, bool, error)
DependencySBOM is the compatibility reader used by SCIP cross-repository package mapping. It keeps its historical contract: identifiers, PURLs and relationships only, with HTTP 403/404 reported as unavailable.
func (*Client) DependencySBOMDocument ¶ added in v0.6.0
func (c *Client) DependencySBOMDocument(ctx context.Context, installationID int64, owner, name string, maxBytes int64) (SBOMDocument, error)
DependencySBOMDocument fetches the SPDX SBOM export losslessly. It returns the SPDX member bytes verbatim (no reserialization), the HTTP status, and throttling headers. maxBytes bounds the whole HTTP body; a larger response is ErrSBOMTooLarge. Non-2xx statuses are returned as SBOMError so callers can classify forbidden, not found, rate limited, and transient outcomes.
func (*Client) DownloadArchive ¶
func (*Client) InstallationRepositories ¶
func (*Client) InstallationToken ¶
func (*Client) Installations ¶
func (c *Client) Installations(ctx context.Context) ([]Installation, error)
func (*Client) ReadContents ¶
func (*Client) SearchCode ¶
func (c *Client) SearchCode(ctx context.Context, installationID int64, query string, repositoryIDs []int64) (api.SearchResponse, error)
SearchCode performs a deliberately best-effort installation-scoped code search. GitHub does not provide an exact-commit consistency guarantee here.
type HTTPStatusError ¶
func (HTTPStatusError) Error ¶
func (err HTTPStatusError) Error() string
func (HTTPStatusError) HTTPStatus ¶
func (err HTTPStatusError) HTTPStatus() int
func (HTTPStatusError) IsRateLimited ¶
func (err HTTPStatusError) IsRateLimited() bool
type Installation ¶
type RateLimit ¶ added in v0.6.0
RateLimit carries GitHub's rate-limit headers when present so a 403 caused by throttling can be told apart from missing access.
type ReconcileAPI ¶
type ReconcileStore ¶
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
func NewReconciler ¶
func NewReconciler(client *Client, store ReconcileStore) *Reconciler
func (*Reconciler) Installation ¶
func (r *Reconciler) Installation(ctx context.Context, installationID int64) error
type Repository ¶
type SBOM ¶
type SBOM struct {
DocumentSPDXID string
DocumentDescribes []string
Packages []SBOMPackage
Relationships []SBOMRelationship
}
type SBOMDocument ¶ added in v0.6.0
type SBOMDocument struct {
Body []byte
MediaType string
Status int
FetchedAt time.Time
RateLimit RateLimit
RetryAfter time.Duration
}
SBOMDocument is one lossless observation of a repository's dependency-graph SBOM export. Body is the exact bytes of the SPDX JSON member as GitHub sent them; the HTTP envelope around it is not retained. FetchedAt is GraphNest's clock, never the document's own creation time.
type SBOMError ¶ added in v0.6.0
SBOMError is a non-2xx SBOM export response. It preserves the status and throttling signals and carries no response body.
func (SBOMError) IsRateLimited ¶ added in v0.6.0
IsRateLimited reports whether the failure is throttling (429, or a 403 with exhausted rate-limit headers) rather than a permission or availability failure. A plain 403 or 404 does not prove the dependency graph is disabled.