Documentation
¶
Index ¶
- Constants
- Variables
- func MetadataValidate(meta *inapi.PackageMetadata) error
- func MinifyCSS(src, dst string) error
- func MinifyHTML(src, dst string) error
- func MinifyJS(src, dst string) error
- func OptimizePNG(src, dst string) error
- func ReleaseValidate(release *inapi.PackageRelease) error
- func SpecFind(packDir string, specOverride string) (string, *inapi.PackageSpec, error)
- func SpecParse(path string) (*inapi.PackageSpec, error)
- func SpecValidate(spec *inapi.PackageSpec) error
- type Builder
- type Config
- type ProcessFunc
Constants ¶
View Source
const ( // PackageMagic is the magic number for .ipk files (4 bytes: "IPK1") PackageMagic = "\x49\x50\x4b\x31" // "IPK1" )
View Source
const (
SpecFileName = "ipk.toml"
)
Variables ¶
View Source
var ( // NameRegex validates package names (lowercase, alphanumeric, hyphens, underscores) NameRegex = regexp.MustCompile(`^[a-z][a-z0-9_-]*$`) )
View Source
var SpecFileSearchOrder = []string{ SpecFileName, filepath.Join(".ipk", SpecFileName), filepath.Join("misc", "ipk", SpecFileName), }
SpecFileSearchOrder defines the order to search for spec files
ValidArch defines the supported CPU architectures
View Source
var ValidOS = map[string]bool{ "linux": true, "freebsd": true, "darwin": true, "all": true, }
ValidOS defines the supported operating systems
Functions ¶
func MetadataValidate ¶
func MetadataValidate(meta *inapi.PackageMetadata) error
MetadataValidate validates package metadata
func OptimizePNG ¶
OptimizePNG optimizes a PNG file using optipng
func ReleaseValidate ¶
func ReleaseValidate(release *inapi.PackageRelease) error
ReleaseValidate validates package release info
func SpecParse ¶
func SpecParse(path string) (*inapi.PackageSpec, error)
SpecParse parses a package spec from a TOML file
func SpecValidate ¶
func SpecValidate(spec *inapi.PackageSpec) error
SpecValidate validates a package spec
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder handles package building
type Config ¶
type Config struct {
// Dir is the package source directory
Dir string
// OutputDir is the output directory for the package
OutputDir string
// SpecFile is the spec file path (optional, auto-detect if empty)
SpecFile string
// Version is the full version with optional pre-release and build metadata
// If empty, uses Metadata.Version (core version only)
// Example: "1.0.0-beta.1+build.123"
Version string
// Os is the operating system target (linux, freebsd, all)
Os string
// Arch is the architecture target (amd64, arm64, src)
Arch string
// Compress is the compression format (xz, gzip)
Compress string
// NoCompress skips final compression (for debugging)
NoCompress bool
// ShowBuild prints the build script before execution
ShowBuild bool
// BuildDir is the build temp directory (for debugging)
BuildDir string
// Quiet suppresses non-error output
Quiet bool
}
Config holds the build configuration
type ProcessFunc ¶
ProcessFunc is a function that processes a file
Click to show internal directories.
Click to hide internal directories.