util

package
v0.0.0-...-7cfd785 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplicationName       = "sbom"
	ApplicationVersion    = "0.5"
	AssociationThresholod = 3
)

Variables

View Source
var Blue = "\033[34m"
View Source
var Green = "\033[32m"
View Source
var Red = "\033[31m"
View Source
var Reset = "\033[0m"
View Source
var White = "\033[97m"
View Source
var Yellow = "\033[33m"

Functions

func CheckFile

func CheckFile(name string) error

func CreateDir

func CreateDir(dir string) error

func CreateTempDir

func CreateTempDir(imageName string) (string, error)

func ExtractLayer

func ExtractLayer(tempDir string, manifest Manifest) (string, error)

func GetCurrentWorkDir

func GetCurrentWorkDir() (string, error)

func GetImageNameAndVersion

func GetImageNameAndVersion(image string) (string, string)

func PrintSbom

func PrintSbom()

func PullImage

func PullImage(image string) (v1.Image, error)

func ReadFile

func ReadFile(filePath string) ([]string, error)

func ReadImageConfig

func ReadImageConfig(tempDir string, manifest Manifest) (v1.ConfigFile, error)

func RemoveDir

func RemoveDir(dir string)

func SaveAndUntarImage

func SaveAndUntarImage(v1Image v1.Image, image string) (string, error)

func UnGzip

func UnGzip(source, target string) error

func Untar

func Untar(tarball, target string) error

func UntarImage

func UntarImage(tarPath string) (string, error)

Types

type Manifest

type Manifest struct {
	Config   string
	RepoTags []string
	Layers   []string
}

func ReadImageManifest

func ReadImageManifest(tempDir string) (Manifest, error)

type OsRelease

type OsRelease struct {
	NAME           string
	ID             string
	VERSION_ID     string
	PRETTY_NAME    string
	HOME_URL       string
	BUG_REPORT_URL string
}

func IdentifyOsRelease

func IdentifyOsRelease(extractDir string) (OsRelease, error)

Jump to

Keyboard shortcuts

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