Documentation
¶
Overview ¶
Package plist provides utilities for generating macOS property list files.
Index ¶
- func EscapeXML(s string) string
- func GenerateDefaultBundleID(appName string) string
- func PermissionDescription(perm Permission) string
- func ValidateAppGroups(appGroups []string) error
- func ValidatePermissions(permissions []Permission) error
- func WriteEntitlements(path string, cfg EntitlementsConfig) error
- func WriteInfoPlist(path string, cfg InfoPlistConfig) error
- type EntitlementsConfig
- type InfoPlistConfig
- type Permission
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeXML ¶
EscapeXML escapes special characters for XML content. This function handles the basic XML entities that need to be escaped when embedding content in XML documents.
func GenerateDefaultBundleID ¶
GenerateDefaultBundleID creates a default bundle ID based on the app name. Uses the same inference logic as the helpers/bundle package.
func PermissionDescription ¶
func PermissionDescription(perm Permission) string
PermissionDescription returns a human-readable description of a permission.
func ValidateAppGroups ¶
ValidateAppGroups validates app group identifiers.
func ValidatePermissions ¶
func ValidatePermissions(permissions []Permission) error
ValidatePermissions checks if all provided permissions are recognized.
func WriteEntitlements ¶
func WriteEntitlements(path string, cfg EntitlementsConfig) error
WriteEntitlements creates an entitlements.plist file at the specified path. It generates entitlements based on the provided permissions, custom entitlements, and app groups.
func WriteInfoPlist ¶
func WriteInfoPlist(path string, cfg InfoPlistConfig) error
WriteInfoPlist creates a minimal Info.plist file at the specified path. It generates a standard macOS app bundle Info.plist with required keys.
Types ¶
type EntitlementsConfig ¶
type EntitlementsConfig struct {
Permissions []Permission
Custom []string
CustomStrings map[string]string
CustomArrays map[string][]string
AppGroups []string
}
EntitlementsConfig holds configuration for generating entitlements.plist files.
type InfoPlistConfig ¶
type InfoPlistConfig struct {
AppName string
BundleID string
ExecName string
Version string
BackgroundOnly bool
CustomKeys map[string]interface{}
}
InfoPlistConfig holds configuration for generating Info.plist files.
type Permission ¶
type Permission string
Permission represents a macOS system permission that can be requested. These correspond to TCC (Transparency, Consent, Control) permission types.
const ( Camera Permission = "camera" // Camera access (com.apple.security.device.camera) Microphone Permission = "microphone" // Microphone access (com.apple.security.device.audio-input) Location Permission = "location" // Location services (com.apple.security.personal-information.location) Files Permission = "files" // File system access with user selection Network Permission = "network" // Network client/server access Sandbox Permission = "sandbox" // App sandbox with restricted file access )
Core permissions covering 95% of use cases.
func GetAvailablePermissions ¶
func GetAvailablePermissions() []Permission
GetAvailablePermissions returns all available standard permissions.