util

package
v0.0.0-...-419708b Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCVEId          = errors.New("invalid cve id")
	ErrInvalidSecurityLevel  = errors.New("invalid security level")
	ErrEmptyCVEId            = errors.New("cve id can't be empty")
	ErrExistCVE              = errors.New("cve already exist")
	ErrNotFoundCVE           = errors.New("cve could not be found")
	ErrAddCVE                = errors.New("cve could not be created")
	ErrDeleteCVE             = errors.New("cve could not be deleted")
	ErrUpdateCVE             = errors.New("cve could not be updated")
	ErrNotPerformedOperation = errors.New("operation could not be performed")
)

Contains error codes for authentication service.

Functions

func CheckSeverity

func CheckSeverity(severity string) (string, error)

CheckSeverity function checks if the given string is a valid severity value ("None", "Low", "Medium", "High", "Critical"). If valid, it converts the string to a format starting with an uppercase letter. If not valid, it returns an error.

func FormatTime

func FormatTime(t time.Time) string

func IsValidCVE

func IsValidCVE(cveID string) bool

isValidCVE checks if the given string is a valid CVE ID

func NormalizeCVEId

func NormalizeCVEId(cveId string) string

NormalizeCVEId normalizes the CVE id.

func ParseTime

func ParseTime(dateStr string) time.Time

func ValidateCVEId

func ValidateCVEId(cveId string) (string, error)

ValidateCVEId validates the CVE id.

Types

This section is empty.

Jump to

Keyboard shortcuts

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