filesystem

package
v1.11.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindKitfileInPath

func FindKitfileInPath(contextDir string) (string, error)

Searches for a kit file in the given context directory. It checks for accepted kitfile names and returns the absolute path for the first found kitfile. If no kitfile is found, returns error

func PathExists

func PathExists(path string) (fs.FileInfo, bool)

func SaveModel added in v1.10.0

func SaveModel(ctx context.Context, localRepo local.LocalRepo, kitfile *artifact.KitFile, ignore ignore.Paths, opts *SaveModelOptions) (*ocispec.Descriptor, error)

SaveModel saves an *artifact.Model to the provided oras.Target, compressing layers. It attempts to block modelkits that include paths that leave the base context directory, allowing only subdirectories of the root context to be included in the modelkit.

func VerifySubpath

func VerifySubpath(context, subDir string) (absPath, relPath string, err error)

VerifySubpath checks that filepath.Join(context, subDir) is a subdirectory of context, following symlinks if present.

Types

type SaveModelOptions added in v1.10.0

type SaveModelOptions struct {
	ModelFormat mediatype.ModelFormat
	Compression mediatype.CompressionType
	LayerFormat mediatype.Format
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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