Documentation
¶
Index ¶
- func GetFormatSerializer(format formats.Format) (native.Serializer, error)
- func RegisterSerializer(format formats.Format, s native.Serializer)
- func UnregisterSerializer(format formats.Format)
- type Options
- type Writer
- func (w *Writer) WriteFile(bom *sbom.Document, path string) error
- func (w *Writer) WriteFileWithOptions(bom *sbom.Document, path string, o *Options) error
- func (w *Writer) WriteStream(bom *sbom.Document, wr io.WriteCloser) error
- func (w *Writer) WriteStreamWithOptions(bom *sbom.Document, wr io.WriteCloser, o *Options) error
- type WriterOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFormatSerializer ¶ added in v0.2.0
func GetFormatSerializer(format formats.Format) (native.Serializer, error)
GetFormatSerializer returns the registered serializer for a specific format. If format is a blank string or no serializer for the format is registered, it will return an error.
func RegisterSerializer ¶ added in v0.2.0
func RegisterSerializer(format formats.Format, s native.Serializer)
RegisterSerializer registers a new serializer to handle writing serialized SBOMs in a specific format. When registerring a new serializer it replaces any other previously defined for the same format.
func UnregisterSerializer ¶ added in v0.2.0
UnregisterSerializer removes a serializer from the list of available
Types ¶
type Options ¶ added in v0.2.0
type Options struct {
Format formats.Format
RenderOptions *native.RenderOptions
SerializeOptions *native.SerializeOptions
// contains filtered or unexported fields
}
func (*Options) GetFormatOptions ¶ added in v0.2.0
func (o *Options) GetFormatOptions(key interface{}) interface{}
func (*Options) SetFormatOptions ¶ added in v0.2.0
func (o *Options) SetFormatOptions(key, opts interface{})
type Writer ¶
type Writer struct {
Options *Options
}
func New ¶
func New(opts ...WriterOption) *Writer
func (*Writer) WriteFileWithOptions ¶ added in v0.2.0
WriteFile takes an sbom.Document and writes it to the file at path
func (*Writer) WriteStream ¶
func (*Writer) WriteStreamWithOptions ¶ added in v0.2.0
WriteStreamWithOptions writes an SBOM in a native format to the stream w using the options set o.
type WriterOption ¶ added in v0.2.0
type WriterOption func(*Writer)
func WithFormat ¶ added in v0.2.0
func WithFormat(f formats.Format) WriterOption
func WithFormatOptions ¶ added in v0.2.0
func WithFormatOptions(driverKey string, opts interface{}) WriterOption
func WithRenderOptions ¶ added in v0.2.0
func WithRenderOptions(ro *native.RenderOptions) WriterOption
func WithSerializeOptions ¶ added in v0.2.0
func WithSerializeOptions(so *native.SerializeOptions) WriterOption
Click to show internal directories.
Click to hide internal directories.