packaging

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package packaging provides ZIP-based plugin packaging and extraction.

Index

Constants

View Source
const (
	// Security limits for ZIP extraction
	MaxFileSize  = 100 << 20 // 100 MB per file
	MaxTotalSize = 500 << 20 // 500 MB total extraction
	MaxFileCount = 1000      // Maximum number of files in archive
)

Variables

This section is empty.

Functions

func PackagePlugin

func PackagePlugin(pluginDir, outputPath string) error

PackagePlugin creates a ZIP package from a plugin directory. The directory should contain:

  • plugin.yaml (required)
  • *.wasm file (required for wasm runtime)
  • binary (required for grpc runtime)
  • assets/ directory (optional)
  • i18n/ directory (optional)

func ValidatePackage

func ValidatePackage(packagePath string) (*pkgplugin.PluginManifest, error)

ValidatePackage checks if a ZIP file is a valid plugin package.

Types

type PluginPackage

type PluginPackage struct {
	Manifest    pkgplugin.PluginManifest
	RuntimeType string            // "wasm", "grpc", or "template"
	BinaryPath  string            // Path to binary/wasm file (empty for template plugins)
	Assets      map[string]string // asset name -> path within package
}

PluginPackage represents a packaged plugin (ZIP file).

func ExtractPlugin

func ExtractPlugin(packagePath, targetDir string) (*PluginPackage, error)

ExtractPlugin extracts a plugin package to the target directory. Returns the package info including manifest and detected runtime type.

Jump to

Keyboard shortcuts

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