types

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version string
	Commit  string
	Date    string
)

we promote the version, commit and date variables to package level globals

Functions

func Filter

func Filter[T any](slice []T, f func(T) bool) []T

func LoadConfig

func LoadConfig(config *ScanConfig, filename string) error

func SeverityToString

func SeverityToString(severity float64) string

Types

type ScanConfig

type ScanConfig struct {
	OutputTemplate string                    `yaml:"output,omitempty"`
	Component      cdx.Component             `yaml:"component,omitempty"`
	Author         cdx.OrganizationalContact `yaml:"author,omitempty"`
	Supplier       cdx.OrganizationalEntity  `yaml:"supplier,omitempty"`
	Manufacturer   cdx.OrganizationalEntity  `yaml:"manufacturer,omitempty"`
}

type SliceSet

type SliceSet[T comparable] []T

SliceSet is useful for _small_ (i.e. <100 items) sets of strings, for larger sets use a map[string]struct{)

func NewSet

func NewSet[T comparable](items ...T) SliceSet[T]

func (SliceSet[T]) Add

func (s SliceSet[T]) Add(item T) SliceSet[T]

func (SliceSet[T]) AddAll

func (s SliceSet[T]) AddAll(other SliceSet[T]) SliceSet[T]

func (SliceSet[T]) Contains

func (s SliceSet[T]) Contains(needle T) bool

func (SliceSet[T]) Distinct

func (s SliceSet[T]) Distinct(other SliceSet[T]) SliceSet[T]

Distinct returns items that are not present in other set (i.e. distinct items)

func (SliceSet[T]) Equals

func (s SliceSet[T]) Equals(other SliceSet[T]) bool

func (SliceSet[T]) IndexOf

func (s SliceSet[T]) IndexOf(needle T) int

func (SliceSet[T]) IsEmpty

func (s SliceSet[T]) IsEmpty() bool

func (SliceSet[T]) Remove

func (s SliceSet[T]) Remove(item T) SliceSet[T]

func (SliceSet[T]) Strings

func (s SliceSet[T]) Strings() []string

Strings is a convenience function to map a set to strings

Jump to

Keyboard shortcuts

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