Documentation ¶
Index ¶
- func CachedGenerate(ctx context.Context, inputFilePath string, f io.Reader, distroID string) (*sbom.SBOM, error)
- func FromSyftJSON(r io.ReadSeeker) (*sbom.SBOM, error)
- func Generate(ctx context.Context, inputFilePath string, f io.Reader, distroID string) (*sbom.SBOM, error)
- func ToSyftJSON(s *sbom.SBOM) (io.ReadSeeker, error)
- func ToSyftJSONSchemaRedacted(s *sbom.SBOM) (io.ReadSeeker, error)
- type TestTarget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CachedGenerate ¶ added in v0.1.0
func CachedGenerate(ctx context.Context, inputFilePath string, f io.Reader, distroID string) (*sbom.SBOM, error)
CachedGenerate behaves similarly to Generate, but it caches the result of the SBOM generation using the user's local XDG cache home directory. Furthermore, if a generated SBOM is already available in the cache for the given APK, CachedGenerate will return the cached SBOM immediately instead of generating a new SBOM.
func FromSyftJSON ¶ added in v0.1.0
func FromSyftJSON(r io.ReadSeeker) (*sbom.SBOM, error)
FromSyftJSON returns an SBOM from a reader of the Syft JSON format.
func Generate ¶
func Generate(ctx context.Context, inputFilePath string, f io.Reader, distroID string) (*sbom.SBOM, error)
Generate creates an SBOM for the given APK file.
func ToSyftJSON ¶ added in v0.1.0
func ToSyftJSON(s *sbom.SBOM) (io.ReadSeeker, error)
ToSyftJSON returns the SBOM as a reader of the Syft JSON format.
func ToSyftJSONSchemaRedacted ¶ added in v0.18.0
func ToSyftJSONSchemaRedacted(s *sbom.SBOM) (io.ReadSeeker, error)
ToSyftJSONSchemaRedacted returns the SBOM as a reader of the Syft JSON format. The returned data has schema information redacted to enable easier testing (less noisy diff comparisons).
For most use cases, prefer ToSyftJSON over this function.
Types ¶
type TestTarget ¶ added in v0.18.0
type TestTarget string
TestTarget represents an APK file that can be used as a test target for integration tests.
func (TestTarget) APKRepoURL ¶ added in v0.18.0
func (tt TestTarget) APKRepoURL(arch string) string
APKRepoURL returns the web URL to the APK file for the given test target for the given architecture.
func (TestTarget) Describe ¶ added in v0.18.0
func (tt TestTarget) Describe(arch string) string
Describe returns a human-readable description of the test target for the given architecture.
func (TestTarget) Download ¶ added in v0.18.0
func (tt TestTarget) Download(arch string) error
Download fetches the APK file for the given test target for the given architecture and writes it to the local filesystem.
If the file already exists, it is not re-downloaded.
func (TestTarget) GoldenFilePath ¶ added in v0.18.0
func (tt TestTarget) GoldenFilePath(arch, suffix string) string
GoldenFilePath returns the local path to the golden file for the given test target. Any given suffix will be appended to the filename (e.g. ".syft.json").
func (TestTarget) LocalPath ¶ added in v0.18.0
func (tt TestTarget) LocalPath(arch string) string
LocalPath returns the local path to the APK file for the given test target for the given architecture. The path is relative to the current working directory.