format

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultEncoding         = formats.JSON
	DefaultSPDXJSONVersion  = formats.SPDX23JSON
	DefaultSPDXTVVersion    = formats.SPDX23TV
	DefaultCycloneDXVersion = formats.CDX15JSON
	JSONFormatMap           = map[string]formats.Format{
		"spdx":     formats.SPDXFORMAT,
		"spdx-2.2": formats.SPDX22JSON,
		"spdx-2.3": formats.SPDX23JSON,

		"cyclonedx":     formats.CDXFORMAT,
		"cyclonedx-1.0": formats.CDX10JSON,
		"cyclonedx-1.1": formats.CDX11JSON,
		"cyclonedx-1.2": formats.CDX12JSON,
		"cyclonedx-1.3": formats.CDX13JSON,
		"cyclonedx-1.4": formats.CDX14JSON,
		"cyclonedx-1.5": formats.CDX15JSON,
	}

	TVFormatMap = map[string]formats.Format{
		"spdx":     formats.SPDXFORMAT,
		"spdx-2.2": formats.SPDX22TV,
		"spdx-2.3": formats.SPDX23TV,
	}

	XMLFormatMap = map[string]formats.Format{}

	JSONEncoding = formats.JSON
	TEXTEncoding = formats.TEXT
	SPDX         = formats.SPDXFORMAT
	CDX          = formats.CDXFORMAT

	EncodingMap = map[string]string{
		"json": formats.JSON,
		"xml":  formats.XML,
		"text": formats.TEXT,
	}
)

Functions

This section is empty.

Types

type Format

type Format struct {
	formats.Format
}

func Detect

func Detect(f io.ReadSeeker) (*Format, error)

func Parse

func Parse(fs string, encoding string) (*Format, error)

Parse parses the format string into a formats.Format

func (*Format) Inverse

func (f *Format) Inverse() (*Format, error)

func (Format) String

func (f Format) String() string

Jump to

Keyboard shortcuts

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