Documentation
¶
Index ¶
- func GetFormatUnserializer(format formats.Format) (native.Unserializer, error)
- func RegisterUnserializer(format formats.Format, u native.Unserializer)
- func UnregisterUnserializer(format formats.Format)
- type Options
- type Reader
- func (r *Reader) ParseFile(path string) (*sbom.Document, error)
- func (r *Reader) ParseFileWithOptions(path string, o *Options) (*sbom.Document, error)
- func (r *Reader) ParseStream(f io.ReadSeeker) (*sbom.Document, error)
- func (r *Reader) ParseStreamWithOptions(f io.ReadSeeker, o *Options) (*sbom.Document, error)
- type ReaderOption
- type Sniffer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFormatUnserializer ¶ added in v0.2.0
func GetFormatUnserializer(format formats.Format) (native.Unserializer, error)
func RegisterUnserializer ¶ added in v0.2.0
func RegisterUnserializer(format formats.Format, u native.Unserializer)
RegisterUnserializer registers a new unserializer to parse a specific format. The new unserializer replaces any previously defined driver.
func UnregisterUnserializer ¶ added in v0.2.0
UnregisterUnserializer removes a serializer from the list of available
Types ¶
type Options ¶ added in v0.2.0
type Options struct {
Format formats.Format
UnserializeOptions *native.UnserializeOptions
// 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 Reader ¶
type Reader struct {
Options *Options
// contains filtered or unexported fields
}
func New ¶
func New(opts ...ReaderOption) *Reader
func (*Reader) ParseFileWithOptions ¶ added in v0.2.0
ParseFile reads a file and returns an sbom.Document
func (*Reader) ParseStream ¶
ParseStreamWithOptions returns a document from a ioreader
func (*Reader) ParseStreamWithOptions ¶ added in v0.2.0
ParseStreamWithOptions returns a document from a ioreader, accept options for unserializer
type ReaderOption ¶ added in v0.2.0
type ReaderOption func(*Reader)
func WithFormatOptions ¶ added in v0.2.0
func WithFormatOptions(driverKey string, opts interface{}) ReaderOption
func WithSniffer ¶ added in v0.2.0
func WithSniffer(s Sniffer) ReaderOption
func WithUnserializeOptions ¶ added in v0.2.0
func WithUnserializeOptions(uo *native.UnserializeOptions) ReaderOption
Click to show internal directories.
Click to hide internal directories.