github.com/google/osv-scalibr@v0.4.1/extractor/filesystem/osv/metadata.go (about) 1 // Copyright 2025 Google LLC 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Package osv defines OSV-specific fields for parsed source packages. 16 package osv 17 18 // Metadata holds parsing information for packages extracted by an OSV extractor wrapper. 19 type Metadata struct { 20 PURLType string 21 Commit string 22 Ecosystem string 23 CompareAs string 24 } 25 26 // DepGroups provides access to the list of dependency groups a package item belongs to. 27 // Dependency groups are used by many language package managers as a way to organize 28 // dependencies (e.g. development dependencies will be in the "dev" group) 29 type DepGroups interface { 30 DepGroups() []string 31 } 32 33 // DepGroupMetadata is a metadata struct that only supports DepGroups 34 type DepGroupMetadata struct { 35 DepGroupVals []string 36 } 37 38 var _ DepGroups = DepGroupMetadata{} 39 40 // DepGroups return the dependency groups property in the metadata 41 func (dgm DepGroupMetadata) DepGroups() []string { 42 return dgm.DepGroupVals 43 }