utils

package
v0.4.12 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrefixNoteName added in v0.4.11

func GetPrefixNoteName(n string) string

func ParsePackageType

func ParsePackageType(v string) string

ParsePackageType parses package type from string.

func ToCVSS

func ToCVSS(baseScore float32, vector string) *g.CVSS

func ToCVSSv3

func ToCVSSv3(baseScore float32, vector string) *g.CVSSv3

func ToFloat32

func ToFloat32(v interface{}) float32

func ToGRPCTime

func ToGRPCTime(v interface{}) *timestamppb.Timestamp

ToGRPCTime converts string to gRPC timestamp.

func ToGrafeasSeverity

func ToGrafeasSeverity(s string) g.Severity

func ToString

func ToString(v interface{}) string

ToString converts interface to string. Hack to avoid panics when converting gabs data to string.

Types

type NoteResource added in v0.3.4

type NoteResource struct {
	Project string
	NoteID  string
}

func GetNoteResource added in v0.3.4

func GetNoteResource(p string) (*NoteResource, error)

func (*NoteResource) Name added in v0.3.4

func (r *NoteResource) Name() string

type Source added in v0.4.0

type Source struct {
	// Project is the associated project.
	Project string

	// URI is the image URI.
	URI string

	// Format of the file to import.
	Format types.SourceFormat

	// Data is the source data.
	Data *gabs.Container
}

func NewFileSource added in v0.4.0

func NewFileSource(project, path, uri string) (*Source, error)

NewFileSource returns a new Source from the given path.

Jump to

Keyboard shortcuts

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