chore: initial commit
Some checks failed
Code Analysis / analysis (push) Failing after 2m59s

This commit is contained in:
2025-12-30 22:34:58 +07:00
commit 35a6349071
63 changed files with 2675 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
syntax = "proto3";
package v1.collections.common;
message CollectionElement {
enum SpecialElementKind {
STR = 0;
OBJ = 1;
}
SpecialElementKind special_element_kind = 1;
oneof element {
int64 integer = 2;
double floating_point = 3;
string str_or_obj = 4;
bool boolean = 5;
}
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
package v1.collections.common;
enum ElementKind {
INT = 0;
FLOAT = 1;
BOOL = 2;
STRING = 3;
OBJECT = 4;
LIST = 5;
}

View File

@@ -0,0 +1,95 @@
syntax = "proto3";
import "v1/collections/common.proto";
import "v1/collections/element_kind.proto";
import "google/protobuf/empty.proto";
package v1.collections.list;
service ListCacheService {
rpc Create(ListCreateRequest) returns (ListCreateResponse);
rpc Get(ListGetRequest) returns (stream ListGetResponse);
rpc Insert(ListInsertRequest) returns (google.protobuf.Empty);
rpc Erase(ListEraseRequest) returns (ListEraseResponse);
rpc Set(ListSetRequest) returns (ListSetResponse);
rpc Length(ListLengthRequest) returns (ListLengthResponse);
rpc PushBack(PushBackRequest) returns (google.protobuf.Empty);
rpc PushMany(stream PushManyRequest) returns (google.protobuf.Empty);
rpc PopBack(PopBackRequest) returns (PopBackResponse);
rpc Clear(ClearRequest) returns (google.protobuf.Empty);
rpc Delete(DeleteRequest) returns (google.protobuf.Empty);
}
message ListCreateRequest {
common.ElementKind element_kind = 1;
optional uint32 ttl_seconds = 2;
}
message ListCreateResponse {
string id = 1;
}
message ListGetRequest {
string id = 1;
}
message ListGetResponse {
common.CollectionElement element = 1;
}
message ListInsertRequest {
string id = 1;
uint64 index = 2;
common.CollectionElement value = 3;
}
message ListEraseRequest {
string id = 1;
int64 index = 2;
}
message ListEraseResponse {
common.CollectionElement removed_value = 1;
}
message ListSetRequest {
string id = 1;
repeated common.CollectionElement elements = 2;
}
message ListSetResponse {
}
message ListLengthRequest {
string id = 1;
}
message ListLengthResponse {
uint64 length = 1;
}
message PushBackRequest {
string id = 1;
common.CollectionElement element = 2;
}
message PushManyRequest {
string id = 1;
common.CollectionElement element = 2;
}
message PopBackRequest {
string id = 1;
}
message PopBackResponse {
common.CollectionElement element = 1;
}
message ClearRequest {
string id = 1;
}
message DeleteRequest {
string id = 1;
}

View File

@@ -0,0 +1,60 @@
syntax = "proto3";
import "google/protobuf/empty.proto";
package v1.object;
service ObjectCacheService {
rpc Create(CreateObjectRequest) returns (CreateObjectResponse);
rpc Get(GetObjectRequest) returns (GetObjectResponse);
rpc Set(SetObjectRequest) returns (google.protobuf.Empty);
rpc Delete(DeleteObjectRequest) returns (google.protobuf.Empty);
rpc GetField(GetObjectFieldRequest) returns (GetObjectFieldResponse);
rpc SetField(SetObjectFieldRequest) returns (google.protobuf.Empty);
rpc DeleteField(DeleteObjectFieldRequest) returns (google.protobuf.Empty);
}
message CreateObjectRequest {
string object = 1;
}
message CreateObjectResponse {
string id = 1;
}
message GetObjectRequest {
string id = 1;
}
message GetObjectResponse {
string object = 1;
}
message SetObjectRequest {
string id = 1;
string new_object = 2;
}
message DeleteObjectRequest {
string id = 1;
}
message GetObjectFieldRequest {
string id = 1;
string field_name = 2;
}
message GetObjectFieldResponse {
string field_value = 1;
}
message SetObjectFieldRequest {
string id = 1;
string field_name = 2;
string value = 3;
}
message DeleteObjectFieldRequest {
string id = 1;
string field_name = 2;
}

View File

@@ -0,0 +1,42 @@
syntax = "proto3";
import "google/protobuf/empty.proto";
package v1.primitives.boolean;
service BoolCacheService {
rpc Create(BoolCreateRequest) returns (BoolCreateResponse);
rpc Set(BoolSetRequest) returns (google.protobuf.Empty);
rpc Get(BoolGetRequest) returns (BoolGetResponse);
rpc Delete(BoolDeleteRequest) returns (BoolDeleteResponse);
}
message BoolCreateRequest {
bool value = 1;
optional uint32 ttl_seconds = 2;
}
message BoolCreateResponse {
string id = 1;
}
message BoolSetRequest {
string id = 1;
bool value = 2;
}
message BoolGetRequest {
string id = 1;
}
message BoolGetResponse {
bool value = 1;
}
message BoolDeleteRequest {
string id = 1;
}
message BoolDeleteResponse {
bool removed_value = 1;
}

View File

@@ -0,0 +1,42 @@
syntax = "proto3";
import "google/protobuf/empty.proto";
package v1.primitives.flt;
service FloatCacheService {
rpc Create(FloatCreateRequest) returns (FloatCreateResponse);
rpc Set(FloatSetRequest) returns (google.protobuf.Empty);
rpc Get(FloatGetRequest) returns (FloatGetResponse);
rpc Delete(FloatDeleteRequest) returns (FloatDeleteResponse);
}
message FloatCreateRequest {
double value = 1;
optional uint32 ttl_seconds = 2;
}
message FloatCreateResponse {
string id = 1;
}
message FloatSetRequest {
string id = 1;
double value = 2;
}
message FloatGetRequest {
string id = 1;
}
message FloatGetResponse {
double value = 1;
}
message FloatDeleteRequest {
string id = 1;
}
message FloatDeleteResponse {
double removed_value = 1;
}

View File

@@ -0,0 +1,42 @@
syntax = "proto3";
import "google/protobuf/empty.proto";
package v1.primitives.integer;
service IntCacheService {
rpc Create(IntCreateRequest) returns (IntCreateResponse);
rpc Set(IntSetRequest) returns (google.protobuf.Empty);
rpc Get(IntGetRequest) returns (IntGetResponse);
rpc Delete(IntDeleteRequest) returns (IntDeleteResponse);
}
message IntCreateRequest {
int64 value = 1;
optional uint32 ttl_seconds = 2;
}
message IntCreateResponse {
string id = 1;
}
message IntSetRequest {
string id = 1;
int64 value = 2;
}
message IntGetRequest {
string id = 1;
}
message IntGetResponse {
int64 value = 1;
}
message IntDeleteRequest {
string id = 1;
}
message IntDeleteResponse {
int64 removed_value = 1;
}

View File

@@ -0,0 +1,42 @@
syntax = "proto3";
import "google/protobuf/empty.proto";
package v1.primitives.str;
service StringCacheService {
rpc Create(StringCreateRequest) returns (StringCreateResponse);
rpc Set(StringSetRequest) returns (google.protobuf.Empty);
rpc Get(StringGetRequest) returns (StringGetResponse);
rpc Delete(StringDeleteRequest) returns (StringDeleteResponse);
}
message StringCreateRequest {
string value = 1;
optional uint32 ttl_seconds = 2;
}
message StringCreateResponse {
string id = 1;
}
message StringSetRequest {
string id = 1;
string value = 2;
}
message StringGetRequest {
string id = 1;
}
message StringGetResponse {
string value = 1;
}
message StringDeleteRequest {
string id = 1;
}
message StringDeleteResponse {
string removed_value = 1;
}