Documentation
¶
Overview ¶
Package internal contains miscellaneous functions and objects useful within syft but should not be used externally.
Index ¶
- Constants
- func CloseAndLogError(closer io.Closer, location string)
- func HasAnyOfPrefixes(input string, prefixes ...string) bool
- func IsErrPath(err error) bool
- func IsErrPathPermission(err error) bool
- func IsPipedInput() (bool, error)
- func IsTerminal() bool
- func MatchAnyFromReader(r io.Reader, res ...*regexp.Regexp) (bool, error)
- func MatchNamedCaptureGroups(regEx *regexp.Regexp, content string) map[string]string
- func MatchNamedCaptureGroupsFromReader(re *regexp.Regexp, r io.Reader) (map[string]string, error)
- func NewBufferedSeeker(rc io.ReadCloser) io.ReadSeekCloser
- func SplitAny(s string, seps string) []string
- func StringInSlice(a string, list []string) bool
- func Tprintf(tmpl string, data map[string]interface{}) string
- func TruncateMiddleEllipsis(input string, maxLen int) string
- type ErrPath
- type Set
Constants ¶
const ( // JSONSchemaVersion is the current schema version output by the JSON encoder // This is roughly following the "SchemaVer" guidelines for versioning the JSON schema. Please see schema/json/README.md for details on how to increment. JSONSchemaVersion = "16.0.22" )
Variables ¶
This section is empty.
Functions ¶
func CloseAndLogError ¶
CloseAndLogError closes the given io.Closer and reports any errors found as a warning in the log
func HasAnyOfPrefixes ¶
HasAnyOfPrefixes returns an indication if the given string has any of the given prefixes.
func IsErrPathPermission ¶
func IsPipedInput ¶
IsPipedInput returns true if there is no input device, which means the user **may** be providing input via a pipe.
func MatchAnyFromReader ¶
MatchAnyFromReader matches any of the provided regular expressions from a reader, assuming the pattern fits within 1.5x the reader chunk size (1MB * 1.5).
func MatchNamedCaptureGroups ¶
MatchNamedCaptureGroups takes a regular expression and string and returns all of the named capture group results in a map. This is only for the first match in the regex. Callers shouldn't be providing regexes with multiple capture groups with the same name.
func MatchNamedCaptureGroupsFromReader ¶
MatchNamedCaptureGroupsFromReader matches named capture groups from a reader, assuming the pattern fits within 1.5x the reader chunk size (1MB * 1.5).
func NewBufferedSeeker ¶
func NewBufferedSeeker(rc io.ReadCloser) io.ReadSeekCloser
func StringInSlice ¶
func TruncateMiddleEllipsis ¶
Types ¶
type Set ¶
type Set[T comparable] map[T]struct{}
Set represents a generic set type.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package bus provides access to a singleton instance of an event bus (provided by the calling application).
|
Package bus provides access to a singleton instance of an event bus (provided by the calling application). |
|
Package log contains the singleton object and helper functions for facilitating logging within the syft library.
|
Package log contains the singleton object and helper functions for facilitating logging within the syft library. |
|
Code generated by go generate; DO NOT EDIT.
|
Code generated by go generate; DO NOT EDIT. |
|
generate
command
|
|