metadata

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ManifestFile = "manifest.pxf"

ManifestFile is the standard file name of the application metadata manifest. It holds the BelluiApp schema encoded in the textual PXF format.

Variables

This section is empty.

Functions

func Save

func Save(f *BelluiApp, w io.Writer) error

Save attempts to write a BelluiApp metadata to the provided writer. The content is encoded in the textual PXF format. If the encoding fails an error will be returned.

func SaveStandard

func SaveStandard(f *BelluiApp, dir string) error

SaveStandard attempts to save a BelluiApp metadata to the `manifest.pxf` file in the specified dir. If the file cannot be written or encoding fails an error will be returned.

func ScaleIcon

func ScaleIcon(data bellui.Resource, size int) bellui.Resource

Types

type AdaptiveIcon

type AdaptiveIcon struct {
	Foreground string
	Background string
	Monochrome string
}

type AppDetails

type AppDetails struct {
	Icon     string
	Name, ID string
	Version  string
	Build    int

	// FileAssociations declares document types that this application can open.
	// The packaging metadata emitted from these entries is what asks the OS to
	// route matching files to the app (macOS CFBundleDocumentTypes, Android
	// ACTION_VIEW intent-filters, Linux desktop MimeType, Windows registry).
	FileAssociations []FileAssociation

	// URLSchemes declares custom URL schemes (without the "://") that this
	// application registers as a handler for, e.g. "myapp" for myapp://open.
	URLSchemes []string
}

AppDetails describes the build information, this group may be OS or arch specific

type AppSource

type AppSource struct {
	Repo, Dir string
}

type BelluiApp

type BelluiApp struct {
	Website      string
	Description  string
	Details      AppDetails
	AdaptiveIcon *AdaptiveIcon

	Development map[string]string
	Release     map[string]string
	Source      *AppSource
	CanOpen     *CanOpen
	LinuxAndBSD *LinuxAndBSD
	Languages   []string
	Migrations  map[string]bool
}

BelluiApp describes the top level metadata for building a bellui application. It is serialized to and from the manifest.pxf file via the textual PXF format; the wire schema lives in belluiapppb/belluiapp.proto and the mapping in convert.go.

func Load

func Load(r io.Reader) (*BelluiApp, error)

Load attempts to read a BelluiApp metadata from the provided reader. The content is decoded from the textual PXF format. If this cannot be done an error will be returned.

Unknown fields are silently ignored (DiscardUnknown). A project's manifest.pxf may carry packaging-tool extension fields (e.g. details.ios_usage_descriptions, consumed by the bellui CLI) that this runtime schema does not model. The runtime only reads a handful of known fields (ID, name, version, build, icon), so an unrecognised extension field must not fail the whole load — otherwise the best-effort dev-mode fallback in app.checkLocalMetadata would spam a parse error on every launch (pre-rebrand tracker #1020). The strict, schema-validating loader used by the packaging CLI lives in a separate copy (cmd/bellui/internal/metadata) and is unaffected.

func LoadStandard

func LoadStandard(dir string) (*BelluiApp, error)

LoadStandard attempts to read a BelluiApp metadata from the `manifest.pxf` file in the specified dir. If the file cannot be found or parsed an error will be returned.

type CanOpen

type CanOpen struct {
	MimeTypes string
}

CanOpen represents a selection of file types (mime etc) that this application can open.

type FileAssociation

type FileAssociation struct {
	// Extensions is the set of file extensions, without the leading dot, that
	// belong to this type (e.g. ["txt", "md"]).
	Extensions []string
	// MimeType is the canonical MIME type for this document type, e.g. "text/plain".
	MimeType string
	// Description is a human readable name for the type, e.g. "Text Document".
	Description string
	// Role is the macOS CFBundleTypeRole for the type: one of "Editor", "Viewer",
	// "Shell" or "None". Defaults to "Editor" when empty. Ignored on other platforms.
	Role string
	// Icon is an optional per-type icon file. Ignored where the platform has no
	// per-document-type icon slot.
	Icon string
}

FileAssociation declares a single document type that the application can open. It maps to per-platform handler metadata emitted by the packaging commands.

type LinuxAndBSD

type LinuxAndBSD struct {
	GenericName string
	Categories  []string
	Comment     string
	Keywords    []string
	ExecParams  string
}

LinuxAndBSD describes specific metadata for desktop files on Linux and BSD.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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