-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
219 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/empty.proto"; | ||
import "protobuf/request.proto"; | ||
package komputer; | ||
|
||
enum Privileges { | ||
AUDIO = 0; | ||
JOKE = 1; | ||
FEATURE_MANAGEMENT = 2; | ||
} | ||
|
||
message AdminRegistration { | ||
string name = 1; | ||
oneof auth_method { | ||
string password = 2; | ||
string public_key = 3; | ||
} | ||
string guildID = 4; | ||
repeated Privileges privileges = 5; | ||
} | ||
|
||
message AdminData { | ||
bytes object_id = 1; | ||
string name = 2; | ||
string guildID = 3; | ||
repeated Privileges privileges = 4; | ||
} | ||
|
||
service AdminService { | ||
rpc List(Pagination) returns (stream AdminData); | ||
rpc New(AdminRegistration) returns (ObjectID); | ||
rpc Update(AdminRegistration) returns (AdminData); | ||
rpc Remove(ObjectID) returns (google.protobuf.Empty); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/empty.proto"; | ||
import "protobuf/request.proto"; | ||
package komputer; | ||
|
||
enum FileFormat { | ||
MP3 = 0; | ||
MP4 = 1; | ||
} | ||
|
||
message AudioInfo { | ||
string name = 1; | ||
FileFormat type = 2; | ||
} | ||
|
||
message Audio { | ||
AudioInfo info = 1; | ||
bytes file = 2; | ||
} | ||
|
||
message File { | ||
bytes content = 1; | ||
uint64 size = 2; | ||
} | ||
|
||
message UploadAudioResponse { | ||
bytes uuid = 1; | ||
uint32 size = 2; | ||
} | ||
|
||
service AudioService { | ||
rpc List(komputer.Pagination) returns (stream AudioInfo); | ||
rpc Add(stream Audio) returns (UploadAudioResponse); | ||
rpc Remove(NameOrIdRequest) returns (google.protobuf.Empty); | ||
} | ||
|
||
service AudioFileService { | ||
rpc Download(FindById) returns (stream File); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/empty.proto"; | ||
import "protobuf/request.proto"; | ||
package komputer; | ||
|
||
enum Type { | ||
SINGLE = 0; | ||
TWO_PART = 1; | ||
} | ||
|
||
enum Category { | ||
PROGRAMMING = 0; | ||
MISC = 1; | ||
DARK = 2; | ||
YOMAMA = 3; | ||
Any = 4; | ||
} | ||
|
||
message Joke { | ||
bytes id = 1; | ||
string answer = 2; | ||
optional string question = 3; | ||
Type type = 4; | ||
Category category = 5; | ||
string guild_id = 6; | ||
} | ||
|
||
message JokeID { | ||
oneof id { | ||
uint64 api_id = 1; | ||
bytes object_id = 2; | ||
} | ||
} | ||
|
||
message DatabaseObjectID { | ||
bytes object_id = 1; | ||
} | ||
|
||
service JokeService { | ||
rpc Find(komputer.FindById) returns (Joke); | ||
rpc Add(Joke) returns (JokeID); | ||
rpc Remove(DatabaseObjectID) returns (google.protobuf.Empty); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/empty.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
package komputer; | ||
|
||
enum Level { | ||
INFO = 0; | ||
DEBUG = 1; | ||
WARN = 2; | ||
ERROR = 3; | ||
} | ||
|
||
message Log { | ||
bytes msg = 1; | ||
optional Level level = 2; | ||
} | ||
|
||
message LogDateRange { | ||
google.protobuf.Timestamp from = 1; | ||
google.protobuf.Timestamp to = 2; | ||
} | ||
|
||
message LogData { | ||
bytes data = 1; | ||
uint32 size = 2; | ||
} | ||
|
||
service StreamLogsService { | ||
rpc Get(google.protobuf.Empty) returns (stream Log); | ||
} | ||
|
||
service LogManager { | ||
rpc CleanUp(LogDateRange) returns (google.protobuf.Empty); | ||
rpc Download(LogDateRange) returns (stream LogData); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
syntax = "proto3"; | ||
|
||
package komputer; | ||
|
||
enum Features { | ||
JOKE_DEV = 0; | ||
HUMOR_API = 1; | ||
DATABASE = 2; | ||
} | ||
|
||
message DatabaseConfig { | ||
string uri = 1; | ||
} | ||
|
||
message HumorAPIConfig { | ||
string api_key = 1; | ||
} | ||
|
||
message FeatureStatus { | ||
Features option = 1; | ||
bool value = 2; | ||
oneof config { | ||
DatabaseConfig database = 3; | ||
HumorAPIConfig humor_api = 4; | ||
} | ||
} | ||
|
||
service ConfigService { | ||
rpc Update(FeatureStatus) returns (FeatureStatus); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/empty.proto"; | ||
package komputer; | ||
|
||
message Pagination { | ||
uint32 page = 1; | ||
uint32 size = 2; | ||
} | ||
|
||
message FindById { | ||
oneof identity { | ||
uint64 id = 1; | ||
bytes uuid = 2; | ||
} | ||
optional Pagination page = 4; | ||
} | ||
|
||
message UUID { | ||
bytes uuid = 1; | ||
} | ||
|
||
message ObjectID { | ||
bytes object_id = 1; | ||
} | ||
|
||
message NameOrIdRequest { | ||
oneof query { | ||
uint64 id = 1; | ||
bytes uuid = 2; | ||
string name = 3; | ||
} | ||
optional Pagination page = 4; | ||
} |