depfile

package
v2.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package depfile provides a temporary abstraction for files that have been opened for extraction. TODO(michaelkedar): This is used for guided remediation, and will be removed after the migration to OSV-Scalibr is complete.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DepFile

type DepFile interface {
	io.Reader

	// Open opens an NestedDepFile based on the path of the
	// current DepFile if the provided path is relative.
	//
	// If the path is an absolute path, then it is opened absolutely.
	Open(path string) (NestedDepFile, error)

	Path() string
}

DepFile is an abstraction for a file that has been opened for extraction, and that knows how to open other DepFiles relative to itself.

type LocalFile

type LocalFile struct {
	// TODO(rexpan): This should be *os.File, as that would allow us to access other underlying functions that definitely will exist
	io.ReadCloser
	// contains filtered or unexported fields
}

A LocalFile represents a file that exists on the local filesystem.

func (LocalFile) Open

func (f LocalFile) Open(path string) (NestedDepFile, error)

func (LocalFile) Path

func (f LocalFile) Path() string

type NestedDepFile

type NestedDepFile interface {
	io.Closer
	DepFile
}

NestedDepFile is an abstraction for a file that has been opened while extracting another file, and would need to be closed.

func OpenLocalDepFile

func OpenLocalDepFile(path string) (NestedDepFile, error)

Jump to

Keyboard shortcuts

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