54 lines
1.5 KiB
V
54 lines
1.5 KiB
V
module aur
|
|
|
|
const aur_rpc_url = 'https://aur.archlinux.org/rpc/'
|
|
|
|
pub struct Package {
|
|
pub:
|
|
id u32 [json: ID]
|
|
name string [json: Name]
|
|
package_base_id u32 [json: PackageBaseID]
|
|
package_base string [json: PackageBase]
|
|
version string [json: Version]
|
|
description string [json: Description]
|
|
url string [json: URL]
|
|
num_votes u32 [json: NumVotes]
|
|
popularity f64 [json: Popularity]
|
|
out_of_date i64 [json: OutOfDate]
|
|
maintainer string [json: Maintainer]
|
|
first_submitted i64 [json: FirstSubmitted]
|
|
last_modified i64 [json: LastModified]
|
|
url_path string [json: URLPath]
|
|
groups []string [json: Groups]
|
|
depends []string [json: Depends]
|
|
make_depends []string [json: MakeDepends]
|
|
opt_depends []string [json: OptDepends]
|
|
check_depends []string [json: CheckDepends]
|
|
conflicts []string [json: Conflicts]
|
|
replaces []string [json: Replaces]
|
|
provides []string [json: Provides]
|
|
license []string [json: License]
|
|
keywords []string [json: Keywords]
|
|
}
|
|
|
|
pub enum SearchType {
|
|
name
|
|
name_desc
|
|
maintainer
|
|
depends
|
|
make_depends
|
|
opt_depends
|
|
check_depends
|
|
}
|
|
|
|
pub fn (st SearchType) str() string {
|
|
return match st {
|
|
.name { 'name' }
|
|
.name_desc { 'name-desc' }
|
|
.maintainer { 'maintainer' }
|
|
.depends { 'depends' }
|
|
.make_depends { 'makedepends' }
|
|
.opt_depends { 'optdepends' }
|
|
.check_depends { 'checkdepends' }
|
|
}
|
|
}
|