sbom

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 10 Imported by: 0

README

SBOM Package

This package provides functionality for working with Software Bill of Materials (SBOM) files in Go applications.

Features

  • Parse SBOM files in multiple formats:
    • CycloneDX
    • SPDX
  • Extract component information
  • Analyze licenses
  • Track dependencies
  • Validate SBOM structure

Usage

import "github.com/neticdk/go-common/pkg/sbom"

// Parse an SBOM file
sbom, err := sbom.Parse("path/to/sbom.json")
if err != nil {
    // Handle error
}

// Get all components
components := sbom.Components()

// Get all licenses
licenses := sbom.Licenses()

// Validate SBOM
if err := sbom.Validate(); err != nil {
    // Handle validation errors
}

Supported Formats

The package currently supports the following SBOM formats:

  • CycloneDX JSON
  • CycloneDX XML
  • SPDX JSON
  • SPDX Tag-Value

Integration

This package is designed to work seamlessly with various SBOM generation tools and can be integrated into existing workflows for software composition analysis and compliance checking.

Documentation

Overview

Package sbom provides functionality for working with Software Bill of Materials (SBOM) files.

This package supports:

- generating SBOMs from parsing kubernetes manifest files.

Basic usage:

// Parse an SBOM file
sbom, err := sbom.Parse("path/to/sbom.json")
if err != nil {
    // Handle error
}

// Get components
components := sbom.Components()

// Check licenses
licenses := sbom.Licenses()

The package supports different SBOM formats and provides utilities for:

  • Parsing SBOM files
  • Extracting component information
  • License analysis
  • Dependency tracking

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSBOMsFromManifest added in v0.2.1

func GenerateSBOMsFromManifest(ctx context.Context, manifest io.Reader) ([]*sbom.SBOM, error)

GenerateSBOMsFromManifest generates SBOMs from the given manifest

func GenerateSBOMsFromPath added in v0.2.1

func GenerateSBOMsFromPath(ctx context.Context, path string) ([]*sbom.SBOM, error)

GenerateSBOMsFromPath generates SBOMs from all manifests in the given path

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL