utils

package
v0.0.0-...-b1d9b20 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContainerRootfsCache *containerrootfs.Cache

ContainerRootfsCache is the container root fs conversion cache that will be used by all the scanners which call ConvertInputToFilesystem.

TODO(sambetts) Stop using a global cache object when once we have support for context.Context in the scanner infrastructure. Once that happens we can pass it down from the family manager to the scanners.

View Source
var InputSizesCache = make(map[string]int64)

InputSizesCache global cache of already calculated input sizes. If input type is a DIR/ROOTFS/FILE than the key is the input path.

Functions

func ConvertInputToFilesystem

func ConvertInputToFilesystem(ctx context.Context, sourceType utils.SourceType, userInput string) (string, func(), error)

func DirSizeMB

func DirSizeMB(path string) (int64, error)

func GetInputSize

func GetInputSize(input types.Input) (int64, error)

func RemoveMountPathSubStringIfNeeded

func RemoveMountPathSubStringIfNeeded(toTrim string, mountPath string) string

func ShouldStripInputPath

func ShouldStripInputPath(inputShouldStrip *bool, familyShouldStrip bool) bool

func TrimMountPath

func TrimMountPath(toTrim string, mountPath string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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