goappimage

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: MIT Imports: 16 Imported by: 0

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

This section is empty.

Types

type AppImage

type AppImage struct {

	//Desktop is the AppImage's main .desktop file parsed as an ini.File.
	Desktop *ini.File
	Path    string
	// updateInformation string TODO: add update stuff
	Name    string
	Version string
	// contains filtered or unexported fields
}

AppImage handles AppImage files.

func NewAppImage

func NewAppImage(path string) (*AppImage, 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) 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) 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) 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