lib

package
v0.0.0-...-e10486e Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

core library for image scanning and tracing commands provides tar parsing, docker manifest logic and bpftrace line handling ensures file path reconstruction handles cwd, overlay fs and dirfd semantics

Index

Constants

This section is empty.

Variables

View Source
var (
	Red     = color(31)
	Green   = color(32)
	Yellow  = color(33)
	Blue    = color(34)
	Magenta = color(35)
	Cyan    = color(36)
	White   = color(37)
)
View Source
var Args = make(map[string]ArgsStruct)
View Source
var Commands = make(map[string]func())
View Source
var Logger = &logger{
	disabled: strings.ToLower(os.Getenv("LOGGING") + " ")[:1] == "n",
}

Functions

func Assert

func Assert(cond bool, format string, a ...interface{})

func Atoi

func Atoi(x string) int

func Chunk

func Chunk(xs []string, chunkSize int) [][]string

func Contains

func Contains(parts []string, part string) bool

func DataDir

func DataDir() string

func Dockerfile

func Dockerfile(ctx context.Context, name string, tarball string) ([]string, error)

func DropLinesWithAny

func DropLinesWithAny(s string, tokens ...string) string

func Exists

func Exists(path string) bool

func FilesHandleLine

func FilesHandleLine(cwds, cgroups map[string]string, line string)

func Max

func Max(i, j int) int

func Panic1

func Panic1(err error)

func Panic2

func Panic2(x interface{}, e error) interface{}

func Pformat

func Pformat(i interface{}) string

func Retry

func Retry(ctx context.Context, fn func() error) error

func SignalHandler

func SignalHandler(cancel func())

func StringOr

func StringOr(s *string, d string) string

Types

type ArgsStruct

type ArgsStruct interface {
	Description() string
}

type DockerfileConfig

type DockerfileConfig struct {
	History []DockerfileHistory `json:"history"`
}

type DockerfileHistory

type DockerfileHistory struct {
	CreatedBy string `json:"created_by"`
}

type File

type File struct {
	Syscall string
	Cgroup  string
	Pid     string
	Ppid    string
	Comm    string
	Errno   string
	File    string
	Dirfd   string
}

func FilesParseLine

func FilesParseLine(line string) File

type Manifest

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

func FindManifest

func FindManifest(manifests []Manifest, name string) (Manifest, error)

type ScanFile

type ScanFile struct {
	LayerIndex  int
	Layer       string
	Path        string
	LinkTarget  string
	Mode        fs.FileMode
	Size        int64
	ModTime     time.Time
	Hash        string
	ContentType string
	Uid         int
	Gid         int
}

func Scan

func Scan(ctx context.Context, name string, tarball string, checkData bool) ([]*ScanFile, map[string]int, error)

func ScanLayer

func ScanLayer(layer string, r io.Reader, checkData bool) ([]*ScanFile, error)

Jump to

Keyboard shortcuts

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