Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Creator ¶
type Creator struct { // Creator is the value of the [Creator] relationship. Creator string // CreatorType is the key of the [Creator] relationship. // In accordance to the SPDX v2 spec, CreatorType should be one of "Person", "Organization", or "Tool". CreatorType string }
Creator describes the creator of the SPDX document that will be produced from the encoding.
type Encoder ¶
type Encoder struct { // The target SPDX version in which to encode. Version Version // The data format in which to encode. Format Format // The SPDX document creator information. Creators []Creator // The SPDX document name field. DocumentName string // The SPDX document namespace field. DocumentNamespace string // The SPDX document comment field. DocumentComment string }
Encoder defines an SPDX encoder and accepts certain values from the caller to use in the SPDX document.
func NewDefaultEncoder ¶
NewDefaultEncoder creates an Encoder with default values and sets optional fields based on the provided options.
func (*Encoder) Encode ¶
Encode encodes a claircore.IndexReport that writes to w. We first convert the IndexReport to an SPDX doc of the latest version, then convert that doc to the specified version. We assume there's no data munging going from latest to the specified version.
type Format ¶
type Format string
Format describes the data format for the SPDX document.
const JSONFormat Format = "json"
type Option ¶
type Option func(*Encoder)
Option is a type for setting optional fields for the Encoder.
func WithDocumentComment ¶
WithDocumentComment is used to set the SPDX document comment field.
func WithDocumentName ¶
WithDocumentName is used to set the SPDX document name field.
func WithDocumentNamespace ¶
WithDocumentNamespace is used to set the SPDX document namespace field.