5 Commits

Author SHA1 Message Date
b8bc25bb8e Fix proto typo
All checks were successful
continuous-integration/drone/push Build is passing
2025-06-27 21:18:18 -04:00
34e63ea6ba Add batch rank rpc
All checks were successful
continuous-integration/drone/push Build is passing
2025-06-27 21:12:49 -04:00
6497b12c5b Add wr list rpc
All checks were successful
continuous-integration/drone/push Build is passing
2025-06-23 23:22:17 -04:00
a1d08b3ea6 Add application owner info
All checks were successful
continuous-integration/drone/push Build is passing
2025-06-22 10:50:47 -04:00
82ca9f2b0c Add dev service
All checks were successful
continuous-integration/drone/push Build is passing
2025-06-22 10:19:28 -04:00
2 changed files with 50 additions and 0 deletions

34
dev.proto Normal file
View File

@@ -0,0 +1,34 @@
syntax = "proto3";
option go_package = "git.itzana.me/strafesnet/go-grpc/dev";
package dev;
service DevService {
rpc Validate(APIValidationRequest) returns (APIValidationResponse);
}
message APIValidationRequest {
string Service = 1;
string Permission = 2;
string Key = 3;
}
message APIValidationResponse {
// Response
bool Valid = 1;
string ErrorMessage = 2;
int32 StatusCode = 3;
// Remaining limits
uint64 RemainingBurst = 4;
uint64 RemainingDaily = 5;
uint64 RemainingMonthly = 6;
// Quota
uint64 BurstLimit = 7;
uint64 BurstDurationSeconds = 8;
uint64 DailyLimit = 9;
uint64 MonthlyLimit = 10;
// Owner info
uint64 UserID = 11;
string Application = 12;
}

View File

@@ -14,7 +14,9 @@ service TimesService {
rpc Delete(IdMessage) returns (NullResponse);
rpc Get(IdMessage) returns (TimeResponse);
rpc List(ListRequest) returns (TimeList);
rpc ListWr(WrListRequest) returns (TimeList);
rpc Rank(IdMessage) returns (RankResponse);
rpc RankBatch(IdListMessage) returns (RankListResponse);
}
message TimeRequest {
@@ -55,13 +57,22 @@ message IdMessage {
int64 ID = 1;
}
message IdListMessage {
repeated int64 ID = 1;
}
message TimeList {
repeated TimeResponse Times = 1;
int64 Total = 2;
}
message RankListResponse {
repeated RankResponse Ranks = 1;
}
message RankResponse {
int64 Rank = 1;
int64 ID = 2;
}
message ListRequest {
@@ -77,6 +88,11 @@ message ListRequest {
uint32 Sort = 4;
}
message WrListRequest {
TimeFilter Filter = 1;
Pagination Page = 2;
}
message Pagination {
int32 Size = 1;
int32 Number = 2;