github.com/nextlinux/gosbom@v0.81.1-0.20230627115839-1ff50c281391/gosbom/formats/cyclonedxjson/format.go (about)

     1  package cyclonedxjson
     2  
     3  import (
     4  	"github.com/CycloneDX/cyclonedx-go"
     5  	"github.com/nextlinux/gosbom/gosbom/formats/common/cyclonedxhelpers"
     6  	"github.com/nextlinux/gosbom/gosbom/sbom"
     7  )
     8  
     9  const ID sbom.FormatID = "cyclonedx-json"
    10  
    11  func Format() sbom.Format {
    12  	return sbom.NewFormat(
    13  		sbom.AnyVersion,
    14  		encoder,
    15  		cyclonedxhelpers.GetDecoder(cyclonedx.BOMFileFormatJSON),
    16  		cyclonedxhelpers.GetValidator(cyclonedx.BOMFileFormatJSON),
    17  		ID,
    18  	)
    19  }