Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeactivateCurrentRice ¶
Deactivates the currently active rice for a program
Types ¶
type Package ¶
type Package struct { Name string `json:"name"` Desc string `json:"description"` Author string `json:"author"` Screenshot string `json:"cover"` Program string `json:"program"` URL string `json:"upstream"` }
A package object represents a package object which will be used for querys and uploads.
func CreatePackage ¶
func CreatePackage(rice *Rice, desc string, author string, screenshot string, url string) (pack *Package, err error)
Creates a package from a rice and other data and stores the information as a json
func GetPackage ¶
Loads a package.json file for an existing rice and returns the struct
type QueryResult ¶
type QueryResult []*Package
The result of a query - used for unmarshalling results
func QueryPackages ¶
func QueryPackages(keyword string) (qRes *QueryResult, err error)
Querys the backend with the given keyword and returns an array of packages as a result
type Rice ¶
type Rice struct { Name string `json:"name"` Program string `json:"prog"` Root string `json:"root"` Files []*RiceFile `json:"files"` }
A rice struct represents a rice with its files and other basic info
func CreateRice ¶
Creates a rice and stores the information as a json
func GetActiveRice ¶
Returns the currently active rice for a program
func (Rice) FirstInit ¶
Initializes a created local rice, extracting the files from the directory to the rdb dir. Should be used to intialize a rice the first time for a given prgoram.