// Copyright 2023 The go-github AUTHORS. All rights reserved.//// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package githubimport ()typeDependencyGraphServiceservice// SBOM represents a software bill of materials, which describes the// packages/libraries that a repository depends on.typeSBOMstruct { SBOM *SBOMInfo`json:"sbom,omitempty"`}// CreationInfo represents when the SBOM was created and who created it.typeCreationInfostruct { Created *Timestamp`json:"created,omitempty"` Creators []string`json:"creators,omitempty"`}// RepoDependencies represents the dependencies of a repo.typeRepoDependenciesstruct { SPDXID *string`json:"SPDXID,omitempty"`// Package name Name *string`json:"name,omitempty"` VersionInfo *string`json:"versionInfo,omitempty"` DownloadLocation *string`json:"downloadLocation,omitempty"` FilesAnalyzed *bool`json:"filesAnalyzed,omitempty"` LicenseConcluded *string`json:"licenseConcluded,omitempty"` LicenseDeclared *string`json:"licenseDeclared,omitempty"`}// SBOMInfo represents a software bill of materials (SBOM) using SPDX.// SPDX is an open standard for SBOMs that// identifies and catalogs components, licenses, copyrights, security// references, and other metadata relating to software.typeSBOMInfostruct { SPDXID *string`json:"SPDXID,omitempty"` SPDXVersion *string`json:"spdxVersion,omitempty"` CreationInfo *CreationInfo`json:"creationInfo,omitempty"`// Repo name Name *string`json:"name,omitempty"` DataLicense *string`json:"dataLicense,omitempty"` DocumentDescribes []string`json:"documentDescribes,omitempty"` DocumentNamespace *string`json:"documentNamespace,omitempty"`// List of packages dependencies Packages []*RepoDependencies`json:"packages,omitempty"`}func ( SBOM) () string {returnStringify()}// GetSBOM fetches the software bill of materials for a repository.//// GitHub API docs: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository////meta:operation GET /repos/{owner}/{repo}/dependency-graph/sbomfunc ( *DependencyGraphService) ( context.Context, , string) (*SBOM, *Response, error) { := fmt.Sprintf("repos/%v/%v/dependency-graph/sbom", , ) , := .client.NewRequest("GET", , nil)if != nil {returnnil, nil, }var *SBOM , := .client.Do(, , &)if != nil {returnnil, , }return , , nil}
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.