Documentation
¶
Index ¶
- func FindKitfileInPath(contextDir string) (string, error)
- func PathExists(path string) (fs.FileInfo, bool)
- func SaveModel(ctx context.Context, localRepo local.LocalRepo, kitfile *artifact.KitFile, ...) (*ocispec.Descriptor, error)
- func VerifySubpath(context, subDir string) (absPath, relPath string, err error)
- type SaveModelOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindKitfileInPath ¶
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 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 ¶
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
}
Click to show internal directories.
Click to hide internal directories.