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: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// SPDX Support
	SPDX_URI        = "text/spdx"
	SPDX_VERSION_22 = "2.2"
	SPDX_VERSION_23 = "2.3"

	// CycloneDX Support
	CDX_URI        = "application/vnd.cyclonedx"
	CDX_VERSION_13 = "1.3"
	CDX_VERSION_14 = "1.4"
	CDX_VERSION_15 = "1.5"

	JSON_ENCODING = "json"
	XML_ENCODING  = "xml"
	TEXT_ENCODING = "text"
)

Variables

View Source
var (
	AllEncoding = []string{JSON_ENCODING, XML_ENCODING, TEXT_ENCODING}
	Versions    = VersionGroups{
		formats.CDXFORMAT: {
			Versions:  []string{CDX_VERSION_13, CDX_VERSION_14, CDX_VERSION_15},
			Encodings: []string{JSON_ENCODING, XML_ENCODING},
			URI:       CDX_URI,
		},
		formats.SPDXFORMAT: {
			Versions:  []string{CDX_VERSION_13, CDX_VERSION_14, CDX_VERSION_15},
			Encodings: []string{JSON_ENCODING, TEXT_ENCODING},
			URI:       SPDX_URI,
		},
	}

	Default = Options{
		Type:     options.Default.Format.Type(),
		Version:  options.Default.Format.Version(),
		Encoding: options.Default.Format.Encoding(),
		URI:      options.Default.Format.URI(),
		Indent:   options.Default.Indent,
	}
)

Functions

This section is empty.

Types

type Options

type Options struct {
	Type     string `yaml:"format,omitempty" json:"format,omitempty"`
	Version  string `yaml:"version,omitempty" json:"version,omitempty"`
	Encoding string `yaml:"encoding,omitempty" json:"encoding,omitempty"`
	URI      string `yaml:"uri,omitempty" json:"uri,omitempty"`
	Indent   int    `yaml:"indent,omitempty" json:"indent,omitempty"`
}

func (*Options) String

func (f *Options) String() string

func (*Options) ToFormat

func (f *Options) ToFormat() formats.Format

func (*Options) ToOptions

func (f *Options) ToOptions() options.Options

type VersionGroup

type VersionGroup struct {
	Format    string
	URI       string
	Versions  []string
	Encodings []string
}

Helper Object

type VersionGroups

type VersionGroups map[string]VersionGroup

func (VersionGroups) EncodingMap

func (v VersionGroups) EncodingMap() map[string][]string

func (VersionGroups) Encodings

func (v VersionGroups) Encodings(format string) []string

func (VersionGroups) Formats

func (v VersionGroups) Formats() []string

func (VersionGroups) URI

func (v VersionGroups) URI(t string) string

func (VersionGroups) VersionMap

func (v VersionGroups) VersionMap() map[string][]string

func (VersionGroups) Versions

func (v VersionGroups) Versions(format string) []string

Jump to

Keyboard shortcuts

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