Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create osvschema go bindings package #292

Merged
merged 13 commits into from
Oct 29, 2024
22 changes: 21 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,30 @@ concurrency:
permissions: {}

jobs:
tests_osv-go:
permissions:
contents: read # to fetch code (actions/checkout)
name: Run `bindings/go` unit tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./bindings/go
steps:
- name: Check out code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: stable
check-latest: true

- run: go test ./...
tests_osv-linter:
permissions:
contents: read # to fetch code (actions/checkout)
name: Run unit tests
name: Run `osv-linter` unit tests
runs-on: ubuntu-latest
defaults:
run:
Expand Down
3 changes: 3 additions & 0 deletions bindings/go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/ossf/osv-schema/bindings/go

go 1.22.7
78 changes: 78 additions & 0 deletions bindings/go/osvschema/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package osvschema

type Ecosystem string

const (
EcosystemAlmaLinux Ecosystem = "AlmaLinux"
EcosystemAlpine Ecosystem = "Alpine"
EcosystemAndroid Ecosystem = "Android"
EcosystemBioconductor Ecosystem = "Bioconductor"
EcosystemBitnami Ecosystem = "Bitnami"
EcosystemConanCenter Ecosystem = "ConanCenter"
EcosystemCRAN Ecosystem = "CRAN"
EcosystemCratesIO Ecosystem = "crates.io"
EcosystemDebian Ecosystem = "Debian"
EcosystemGitHubActions Ecosystem = "GitHub Actions"
EcosystemGo Ecosystem = "Go"
EcosystemHex Ecosystem = "Hex"
EcosystemLinux Ecosystem = "Linux"
EcosystemMaven Ecosystem = "Maven"
EcosystemNPM Ecosystem = "npm"
EcosystemNuGet Ecosystem = "NuGet"
EcosystemOSSFuzz Ecosystem = "OSS-Fuzz"
EcosystemPackagist Ecosystem = "Packagist"
EcosystemPhotonOS Ecosystem = "Photon OS"
EcosystemPub Ecosystem = "Pub"
EcosystemPyPI Ecosystem = "PyPI"
EcosystemRedHat Ecosystem = "Red Hat"
EcosystemRockyLinux Ecosystem = "Rocky Linux"
EcosystemRubyGems Ecosystem = "RubyGems"
EcosystemSwiftURL Ecosystem = "SwiftURL"
EcosystemUbuntu Ecosystem = "Ubuntu"
)

type SeverityType string

const (
SeverityCVSSV2 SeverityType = "CVSS_V2"
SeverityCVSSV3 SeverityType = "CVSS_V3"
SeverityCVSSV4 SeverityType = "CVSS_V4"
)

type RangeType string

const (
RangeSemVer RangeType = "SEMVER"
RangeEcosystem RangeType = "ECOSYSTEM"
RangeGit RangeType = "GIT"
)

type ReferenceType string

const (
ReferenceAdvisory ReferenceType = "ADVISORY"
ReferenceArticle ReferenceType = "ARTICLE"
ReferenceDetection ReferenceType = "DETECTION"
ReferenceDiscussion ReferenceType = "DISCUSSION"
ReferenceReport ReferenceType = "REPORT"
ReferenceFix ReferenceType = "FIX"
ReferenceIntroduced ReferenceType = "INTRODUCED"
ReferencePackage ReferenceType = "PACKAGE"
ReferenceEvidence ReferenceType = "EVIDENCE"
ReferenceWeb ReferenceType = "WEB"
)

type CreditType string

const (
CreditFinder CreditType = "FINDER"
CreditReporter CreditType = "REPORTER"
CreditAnalyst CreditType = "ANALYST"
CreditCoordinator CreditType = "COORDINATOR"
CreditRemediationDeveloper CreditType = "REMEDIATION_DEVELOPER" //nolint:gosec
CreditRemediationReviewer CreditType = "REMEDIATION_REVIEWER" //nolint:gosec
CreditRemediationVerifier CreditType = "REMEDIATION_VERIFIER" //nolint:gosec
CreditTool CreditType = "TOOL"
CreditSponsor CreditType = "SPONSOR"
CreditOther CreditType = "OTHER"
)
Loading