app

package
v0.0.0-...-d8e89f0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2015 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//DS is the location of the application ds file
	DS = "core" + string(os.PathSeparator) + "app.ds"
)

Variables

View Source
var (
	// ErrNoWebInstall is when web based applicadtion installs are not allowed
	ErrNoWebInstall = errors.New("Web based application installs are not allowed on this instance. " +
		"See the AllowWebAppInstall Setting for more information.")
	//ErrAppNotFound is when the app.json file can't be found in the app zip file
	ErrAppNotFound = errors.New("Invalid application file path. Application file not found.")
	//ErrAppInvalid is when the application zip file can't be read or extracted
	ErrAppInvalid = errors.New("Application file is an invalid format and cannot be installed.")

	//ErrInvalidID is when the application ID is invalid
	ErrInvalidID = errors.New("Invalid App ID")
)

Functions

func All

func All() (map[string]*App, error)

All returns all installed applications

func Available

func Available() (map[string]*App, []error, error)

Available returns all Available Applications, including those already installed

func PostAvailable

func PostAvailable(uri string) (string, error)

PostAvailable uses an HTTP client to retrieve a zip from from an external url and puts it in the available folder for installation

func Uninstall

func Uninstall(appID string) error

Uninstall removes the application from the instance

Types

type App

type App struct {
	ID          string `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Author      string `json:"author,omitempty"`
	Root        string `json:"root,omitempty"`
	Icon        string `json:"icon,omitempty"`
	Version     string `json:"version,omitempty"`
	File        string `json:"file,omitempty"`
}

App is the structure of an Application Install

func Get

func Get(ID string) (*App, error)

Get retrieves an Application based on the passed in ID

func Install

func Install(file, owner string) (*App, error)

Install installs the application at the file path, and sets the passed in owner as the owner of the file

func Upgrade

func Upgrade(file, owner string) (*App, error)

Upgrade upgrades the application identified by the passed in filepath with the contents of the passed in filepath, setting the owner to the files therein to the owner passed in

type Resource

type Resource struct {
	Filepath string
}

Resource is a resource definition for a file in an application zip file, used for setting permissions by satisfying the permitter interface

func (*Resource) ID

func (a *Resource) ID() string

ID is the unique identifier for this resource

func (*Resource) Permission

func (a *Resource) Permission() (*permission.Permission, error)

Permission is here to satisfy the permitter interface, but I'm cheating as it's only used setting permissions on not retrieving them. Seems I have a leaky abstraction TODO: reconsider this

Jump to

Keyboard shortcuts

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