lure-web-old/backend/internal/api/lure.proto

82 lines
2.0 KiB
Protocol Buffer

syntax = "proto3";
package lure;
// Slight hack to provide protoc with a package name
option go_package = "../api";
// SORT_BY represents possible things to sort packages by
enum SORT_BY {
UNSORTED = 0;
NAME = 1;
REPOSITORY = 2;
VERSION = 3;
}
// FILTER_TYPE represents possible filters for packages
enum FILTER_TYPE {
NO_FILTER = 0;
IN_REPOSITORY = 1;
SUPPORTS_ARCH = 2;
}
// SearchRequest is a request to search for packages
message SearchRequest {
string query = 1;
int64 limit = 2;
SORT_BY sort_by = 3;
FILTER_TYPE filter_type = 4;
optional string filter_value = 5;
}
// StringList contains a list of strings
message StringList {
repeated string entries = 1;
}
// Package represents a LURE package
message Package {
string name = 1;
string repository = 2;
string version = 3;
int64 release = 4;
optional int64 epoch = 5;
optional string description = 6;
optional string homepage = 7;
optional string maintainer = 8;
repeated string architectures = 9;
repeated string licenses = 10;
repeated string provides = 11;
repeated string conflicts = 12;
repeated string replaces = 13;
map<string, StringList> depends = 14;
map<string, StringList> build_depends = 15;
}
message GetPackageRequest {
string name = 1;
string repository = 2;
}
// SearchResponse contains returned packages
message SearchResponse {
repeated Package packages = 1;
}
message GetBuildScriptRequest {
string name = 1;
string repository = 2;
}
message GetBuildScriptResponse {
string script = 1;
}
// Web is the LURE Web service
service API {
// Search searches through LURE packages in the database
rpc Search(SearchRequest) returns (SearchResponse);
// GetPkg gets a single LURE package from the database
rpc GetPkg(GetPackageRequest) returns (Package);
// GetBuildScript returns the build script for the given package
rpc GetBuildScript(GetBuildScriptRequest) returns (GetBuildScriptResponse);
}