github.com/noqcks/syft@v0.0.0-20230920222752-a9e2c4e288e5/syft/encode_decode.go (about)

     1  package syft
     2  
     3  import (
     4  	"io"
     5  
     6  	"github.com/anchore/syft/syft/formats"
     7  	"github.com/anchore/syft/syft/sbom"
     8  )
     9  
    10  // TODO: deprecated, moved to syft/formats/formats.go. will be removed in v1.0.0
    11  func Encode(s sbom.SBOM, f sbom.Format) ([]byte, error) {
    12  	return formats.Encode(s, f)
    13  }
    14  
    15  // TODO: deprecated, moved to syft/formats/formats.go. will be removed in v1.0.0
    16  func Decode(reader io.Reader) (*sbom.SBOM, sbom.Format, error) {
    17  	return formats.Decode(reader)
    18  }