packaging

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDirectoryTarArchive

func CreateDirectoryTarArchive(dirPath string) (string, error)

CreateDirectoryTarArchive creates a temporary tar archive containing the specified directory with its structure preserved. Symlinks encountered in the directory are skipped and will not be included in the archive. It returns the path to the temporary tar file and any error encountered. The caller is responsible for removing the temporary file when done.

func CreateTempConfigArchive

func CreateTempConfigArchive(configFiles []string) (string, error)

CreateTempConfigArchive creates a temporary tar archive containing the specified config files. It returns the path to the temporary tar file and any error encountered. The caller is responsible for removing the temporary file when done.

func PackageFromDirectory

func PackageFromDirectory(dirPath string) (safetensorsPaths []string, tempConfigArchive string, err error)

PackageFromDirectory scans a directory for safetensors files and config files, creating a temporary tar archive of the config files. It returns the paths to safetensors files, path to temporary config archive (if created), and any error encountered.

Types

type DirTarProcessor

type DirTarProcessor struct {
	// contains filtered or unexported fields
}

DirTarProcessor handles processing of directory tar paths for packaging

func NewDirTarProcessor

func NewDirTarProcessor(dirTarPaths []string, baseDir string) *DirTarProcessor

NewDirTarProcessor creates a new processor for directory tar paths

func (*DirTarProcessor) Process

func (p *DirTarProcessor) Process() ([]string, func(), error)

Process processes all directory tar paths, validates them, and creates temporary tar archives. Returns a list of temporary tar file paths, cleanup function, and any error encountered. The caller is responsible for adding these tar files to the builder.

Jump to

Keyboard shortcuts

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