writer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Writer)

type Serializer

type Serializer interface {
	Serialize(options.Options, *sbom.Document) (interface{}, error)
	Render(options.Options, interface{}, io.Writer) error
}

type SerializerCDX

type SerializerCDX struct{}

func (*SerializerCDX) Serialize

func (s *SerializerCDX) Serialize(opts options.Options, bom *sbom.Document) (interface{}, error)

type SerializerCDX14

type SerializerCDX14 struct {
	SerializerCDX
}

SerializerCDX14 is an object that writes a protobuf sbom to CycloneDX 1.4

func (*SerializerCDX14) Render

func (s *SerializerCDX14) Render(_ options.Options, doc interface{}, wr io.Writer) error

Render is a wrapper on top of the general CDX serializer

type SerializerSPDX23

type SerializerSPDX23 struct{}

func (*SerializerSPDX23) Render

func (s *SerializerSPDX23) Render(opts options.Options, doc interface{}, wr io.Writer) error

func (*SerializerSPDX23) Serialize

func (s *SerializerSPDX23) Serialize(opts options.Options, bom *sbom.Document) (interface{}, error)

Serialize takes a protobom and returns an SPDX 2.3 struct

type Writer

type Writer struct {
	Options options.Options
	// contains filtered or unexported fields
}

func New

func New() *Writer

func (*Writer) WriteFile

func (w *Writer) WriteFile(bom *sbom.Document, path string) error

func (*Writer) WriteStream

func (w *Writer) WriteStream(bom *sbom.Document, wr io.WriteCloser) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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