goappimage

package
v0.0.0-...-6866993 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 15 Imported by: 1

README

GoAppImage

AppImage manipulation from Go.

Currently tries to read the squashfs using pure go (using this library). If that doesn't work, falls back to calling unsquashfs.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAppImage

func IsAppImage(path string) bool

Types

type AppImage

type AppImage struct {

	//Desktop is the AppImage's main .desktop file parsed as an ini.File.
	Desktop    *ini.File
	Path       string
	Name       string
	UpdateInfo string
	Version    string
	// contains filtered or unexported fields
}

AppImage handles AppImage files.

func NewAppImage

func NewAppImage(path string) (ai *AppImage, err error)

NewAppImage creates an AppImage object from the location defined by path. Returns an error if the given path is not an appimage, or is a temporary file. In all instances, will still return the AppImage.

func (AppImage) Args

func (ai AppImage) Args() ([]string, error)

func (AppImage) ExtractFile

func (ai AppImage) ExtractFile(filepath string, destinationdirpath string, resolveSymlinks bool) error

ExtractFile extracts a file from from filepath (which may contain * wildcards) in an AppImage to the destinationdirpath.

If resolveSymlinks is true, if the filepath specified is a symlink, the actual file is extracted in it's place. resolveSymlinks will have no effect on absolute symlinks (symlinks that start at root).

func (AppImage) ExtractFileReader

func (ai AppImage) ExtractFileReader(filepath string) (io.ReadCloser, error)

ExtractFileReader tries to get an io.ReadCloser for the file at filepath. Returns an error if the path is pointing to a folder. If the path is pointing to a symlink, it will try to return the file being pointed to, but only if it's within the AppImage.

func (AppImage) Icon

func (ai AppImage) Icon() (io.ReadCloser, string, error)

Icon tries to get a io.ReadCloser for the icon dictated in the AppImage's desktop file. Returns the ReadCloser and the file's name (which could be useful for decoding).

func (AppImage) ListFiles

func (ai AppImage) ListFiles(folder string) []string

func (AppImage) ModTime

func (ai AppImage) ModTime() time.Time

ModTime is the time the AppImage was edited/created. If the AppImage is type 2, it will try to get that information from the squashfs, if not, it returns the file's ModTime.

func (AppImage) SquashfsReader

func (ai AppImage) SquashfsReader() (*squashfs.Reader, error)

SquashfsReader allows direct access to an AppImage's squashfs. Only works on type 2 AppImages

func (AppImage) Thumbnail

func (ai AppImage) Thumbnail() (io.ReadCloser, error)

Thumbnail tries to get the AppImage's thumbnail and returns it as a io.ReadCloser.

func (AppImage) Type

func (ai AppImage) Type() int

Type is the type of the AppImage. Should be either 1 or 2.

Jump to

Keyboard shortcuts

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