format

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MulanPSL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const SEP = "-"

Variables

This section is empty.

Functions

func FormatName

func FormatName(f Format) string

FormatName returns a sbom format full name

Types

type Format

type Format interface {
	Spec() Specification         // Specification returns the spec of this format
	Type() string                // Type returns the format type
	Load(reader io.Reader) error // Load loads a sbom from reader
	Dump(writer io.Writer) error // Dump dumps a sbom to writer
}

Format is a sbom file format

type Specification

type Specification interface {
	Name() string             // Name returns the spec name
	Version() string          // Version returns the spec version
	Metadata() model.Metadata // Metadata returns the metadata,e.g. creator / tool / created
	Validate() error          // Validate validates the spec
	Formats() []Format        // Formats returns all formats of this spec
	FromModel(*model.SBOM)    // FromModel converts a SBOM model to spec
	ToModel() *model.SBOM     // ToModel converts spec to a SBOM model
	Updaters() []Updater
}

Specification is a sbom specfication

type Updater

type Updater interface {
	Name() string
	Update(string) error
	Desc() string
}

func NewUpdater

func NewUpdater(name string, desc string, update func(string) error) Updater

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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