Documentation ¶
Index ¶
- Constants
- func AddFileExtension(filename, outputType string) string
- func CleanJSON(jsonString string) (string, error)
- func CleanValue(v interface{}) interface{}
- func DetectCDXHashAlgorithm(hash string) cyclonedx.HashAlgorithm
- func FormatImage(image string) string
- func GenerateURN(nid string) string
- func IsDir(path string) bool
- func IsDirExists(path string) (bool, error)
- func IsFileExists(path string) (bool, error)
- func SaveToFile(data interface{}, path, format string) error
- func SplitAndAppendStrings(target []string) []string
- func SplitAny(s string, seps string) []string
- func SplitContentsByEmptyLine(contents string) []string
- func SplitString(str string) []string
- func StringSliceContains(s []string, e string) bool
- func ToJSON(t interface{}) ([]byte, error)
- func ToTitle(str string) string
- func ToXML(data interface{}) ([]byte, error)
- func ToYAML(t interface{}) ([]byte, error)
- func WriteFile(data []byte, path string) error
- func WriteYAML(t interface{}, path string) error
Constants ¶
View Source
const ( DefaultImageTag string = "latest" ImageSeparator string = ":" )
Variables ¶
This section is empty.
Functions ¶
func AddFileExtension ¶
func CleanJSON ¶ added in v1.12.3
CleanJSON removes trailing carriage return, newline, and backslash from a JSON string.
func CleanValue ¶ added in v1.12.3
func CleanValue(v interface{}) interface{}
CleanValue removes trailing carriage return, newline, and backslash from a JSON value.
func DetectCDXHashAlgorithm ¶ added in v1.13.0
func DetectCDXHashAlgorithm(hash string) cyclonedx.HashAlgorithm
DetectHashAlgorithm identifies the hash algorithm based on the input hash.
func FormatImage ¶
FormatImage set default image tag if not provided
func GenerateURN ¶
func IsDir ¶
IsDir checks if the given input is a directory. It returns true if the input is a directory, false otherwise.
func IsDirExists ¶
IsDirExists checks if a directory exists and is valid.
func IsFileExists ¶
IsFileExists checks if a file exists and is valid.
func SaveToFile ¶
func SplitAndAppendStrings ¶
func SplitString ¶
func StringSliceContains ¶
StringSliceContains checks if a string slice contains specified string
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.