shared

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotABool indicates a string value that cannot be converted to a bool
	ErrNotABool = errors.New("Not a valid boolean string")
)
View Source
var ErrNotLicense = errors.New("Licenses must be a single string or an array of strings")

ErrNotLicense indicates that a Licenses is being read from invalid YAML or written when empty

Functions

This section is empty.

Types

type DefaultFalse

type DefaultFalse struct {
	Valid bool
	Bool  bool
}

DefaultFalse is a boolean which should omitted if false when marshaling

func (DefaultFalse) MarshalYAML

func (df DefaultFalse) MarshalYAML() (out interface{}, err error)

MarshalYAML writes a DefaultFalse as "yes" if true and omits it if empty or invalid

func (*DefaultFalse) UnmarshalYAML

func (df *DefaultFalse) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML converts a string to a DefaultFalse based on its value

type DefaultTrue

type DefaultTrue struct {
	Valid bool
	Bool  bool
}

DefaultTrue is a boolean which should omitted if true when marshaling

func (DefaultTrue) MarshalYAML

func (dt DefaultTrue) MarshalYAML() (out interface{}, err error)

MarshalYAML writes a DefaultTrue as "no" if false and omits it if empty or invalid

func (*DefaultTrue) UnmarshalYAML

func (dt *DefaultTrue) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML converts a string to a DefaultTrue based on its value

type Licenses

type Licenses []yaml.Node

Licenses is allowed to contain one or more SPDX license identifiers, but may be a scalar or a list in YAML

func (Licenses) MarshalYAML

func (l Licenses) MarshalYAML() (out interface{}, err error)

MarshalYAML converts Licenses to a string (singular) or list (plural) when writing YAML

func (*Licenses) UnmarshalYAML

func (l *Licenses) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML converts a string (singular) or list (plural) to Licenses when reading YAML

type Source

type Source map[string]string

Source is a single entry map of URI to hash or Git Reference

func NewSource

func NewSource(URI string) (src Source, err error)

NewSource builds a new Source from a URI

func UpdateSources

func UpdateSources(URIs []string) (srcs []Source, err error)

UpdateSources gets the hashes for one or more URI sources

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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