Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindGitHub ¶
FindGitHub searches deps.dev for a GitHub link.
func UpdateAllRepos ¶
func UpdateAllRepos(repos []Repo)
UpdateAllRepos takes in a slice of Repo structs and updates the OSI data for each one.
Types ¶
type PackageData ¶
type PackageData struct { PackageKey PackageKey `json:"packageKey"` Versions []Version `json:"versions"` }
Package Data is a struct that contains PackageKey and Versions for a package.
type PackageKey ¶
PackageKey is a struct that contains ssystem and name for a package.
type Project ¶
type Project struct { ProjectKey struct { ID string `json:"id"` } `json:"projectKey"` OpenIssuesCount string `json:"openIssuesCount"` StarsCount string `json:"starsCount"` ForksCount string `json:"forksCount"` License string `json:"license"` Description string `json:"description"` Homepage string `json:"homepage"` Scorecard struct { Date string `json:"date"` Repository struct { Name string `json:"name"` Commit string `json:"commit"` } `json:"repository"` Scorecard struct { Version string `json:"version"` Commit string `json:"commit"` } `json:"scorecard"` Checks []struct { Name string `json:"name"` Documentation struct { ShortDescription string `json:"shortDescription"` URL string `json:"url"` } `json:"documentation"` Score string `json:"score"` Reason string `json:"reason"` Details []string `json:"details"` } `json:"checks"` OverallScore float32 `json:"overallScore"` Metadata []string `json:"metadata"` } `json:"scorecard"` }
Project is a struct that contains information about a project.
type Repo ¶
type Repo struct { Link string AlternateLink string ModVersion string OSIData Project VersionData PackageData }
Repo is a struct that contains links, versions abd other data about a repository.
func ExtractRepoInfo ¶
ExtractRepoInfo takes in a filepath to a go.mod file and returns a slice of Repo structs.
func LinksToRepos ¶
LinksToRepos takes in a go.mod file as a byte slice and returns a slice of Repo structs.
func (*Repo) GetOSIData ¶
GetOSIData GET call to the OSI API "projects" endpoint. See documentation for more detail: https://docs.deps.dev/api/v3alpha/#getproject
func (*Repo) GetPackageData ¶
GetPackageData GET call to the OSI API "packages" endpoint.
func (*Repo) IsLatestVersion ¶
IsLatestVersion returns 1 if the package is the latest version, 0 if it is not, and -1 if there is no OSI data.
func (*Repo) LatestVersion ¶
LatestVersion returns the latest version of the package.
type Version ¶
type Version struct { VersionKey VersionKey `json:"versionKey"` IsDefault bool `json:"isDefault"` }
Version is a version of a module.
type VersionKey ¶
type VersionKey struct { System string `json:"system"` Name string `json:"name"` Version string `json:"version"` }
VersionKey is the key for a version of a module.