Documentation ¶
Index ¶
- Variables
- type AppImage
- func (ai *AppImage) Architectures() []string
- func (ai *AppImage) DataDir() string
- func (ai *AppImage) Destroy() error
- func (ai *AppImage) ExtractFile(path string, dest string, resolveSymlinks bool) error
- func (ai *AppImage) ExtractFileReader(path string) (io.ReadCloser, error)
- func (ai *AppImage) Icon() (io.ReadCloser, string, error)
- func (ai *AppImage) IsMounted() bool
- func (ai *AppImage) Md5() string
- func (ai *AppImage) Mount(dest ...string) error
- func (ai *AppImage) MountDir() string
- func (ai AppImage) Permissions() (*permissions.AppImagePerms, error)
- func (ai *AppImage) RootDir() string
- func (ai *AppImage) Sandbox(perms *permissions.AppImagePerms, args []string) error
- func (ai *AppImage) SetDataDir(d string)
- func (ai *AppImage) SetRootDir(d string)
- func (ai *AppImage) SetTempDir(d string)
- func (ai *AppImage) SetTrusted(trusted bool) error
- func (ai *AppImage) TempDir() string
- func (ai *AppImage) Thumbnail() (io.Reader, error)
- func (ai *AppImage) Trusted() bool
- func (ai *AppImage) Type() int
- func (ai *AppImage) Unmount() errordeprecated
- func (ai AppImage) WrapArgs(perms *permissions.AppImagePerms, args []string) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
var ( NilAppImage = errors.New("AppImage is nil") NoPath = errors.New("AppImage contains no path") NotMounted = errors.New("AppImage is not mounted") InvalidDesktopFile = errors.New("desktop file wasn't parsed") NoDesktopFile = errors.New("no (or >1) desktop entry was found inside bundle") NoIcon = errors.New("bundle doesn't specify an icon") InvalidIconExtension = errors.New("no valid icon extensions (svg, png) found inside bundle") NoMountPoint = errors.New("mount point doesn't exist") )
var (
Version = "UNDEFINED"
)
Current version of aisap Defined in `zig/build.zig.zon` When using aisap as a library, `--ldflags="-X github.com/mgord9518/aisap.Version=[VERSION HERE]"` should be updated to the value contained in build.zig.zon
Functions ¶
This section is empty.
Types ¶
type AppImage ¶
type AppImage struct { Desktop *ini.File // INI of internal desktop entry Path string // Location of AppImage Name string // AppImage name from the desktop entry Version string UpdateInfo string Offset int // Offset of SquashFS image // These will both be removed when the Zig-implemented C bindings // become usable CurrentArg int // Should only ever be used for the C bindings WrapArgsList []string // Should only ever be used for the C bindings // contains filtered or unexported fields }
func NewAppImage ¶
Create a new AppImage object from a path
func (*AppImage) Architectures ¶
func (*AppImage) ExtractFile ¶
Extract a file from the AppImage's interal filesystem image
func (*AppImage) ExtractFileReader ¶
func (ai *AppImage) ExtractFileReader(path string) (io.ReadCloser, error)
Like `ExtractFile()` but gives access to the reader instead of extracting
func (*AppImage) Icon ¶
func (ai *AppImage) Icon() (io.ReadCloser, string, error)
Returns the icon reader of the AppImage, valid formats are SVG and PNG
func (*AppImage) Mount ¶
Takes an optional argument to mount at a specific location (failing if it doesn't exist or more than one arg given. If none given, automatically create a temporary directory and mount to it
func (AppImage) Permissions ¶
func (ai AppImage) Permissions() (*permissions.AppImagePerms, error)
Retrieve permissions from the AppImage in the following order:
1: User-configured settings in ~/.local/share/aisap/profiles/[ai.Name] 2: aisap internal permissions library 3: Permissions defined in the AppImage's desktop file
func (*AppImage) Sandbox ¶
func (ai *AppImage) Sandbox(perms *permissions.AppImagePerms, args []string) error
Executes AppImage through bwrap and creates a portable home if one doesn't already exist Returns error if AppImagePerms.Level < 1
func (*AppImage) SetDataDir ¶
Set the directory for the sandboxed AppImage's `HOME`
func (*AppImage) SetRootDir ¶
Set the directory the sandbox pulls system files from
func (*AppImage) SetTempDir ¶
Set the directory for the sandboxed AppImage's `TMPDIR`
func (*AppImage) SetTrusted ¶
func (*AppImage) Trusted ¶
Returns `true` if the AppImage in question is both executable and has its profile copied to the aisap config dir. This is to ensure the permissions can't change under the user's feet through an update to the AppImage
func (AppImage) WrapArgs ¶
func (ai AppImage) WrapArgs(perms *permissions.AppImagePerms, args []string) ([]string, error)
Returns the bwrap arguments to sandbox the AppImage