Skip to content

Commit f84d5f0

Browse files
author
Viev
committed
- Initial Commit
1 parent 2489b1c commit f84d5f0

File tree

70 files changed

+96445
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+96445
-0
lines changed
Binary file not shown.

.vs/TypeDBGRPCClient/v16/.suo

54.5 KB
Binary file not shown.

Connection.cs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using Grpc.Net.Client;
3+
4+
namespace TypeDBGRPCClient
5+
{
6+
public class Connection
7+
{
8+
9+
static void Main (string[] args)
10+
{
11+
var blah = GrpcChannel.ForAddress("https://asdfasdf");
12+
13+
14+
}
15+
16+
17+
}
18+
}

Protos/cluster/BUILD

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#
2+
# Copyright (C) 2021 Vaticle
3+
#
4+
# This program is free software: you can redistribute it and/or modify
5+
# it under the terms of the GNU Affero General Public License as
6+
# published by the Free Software Foundation, either version 3 of the
7+
# License, or (at your option) any later version.
8+
#
9+
# This program is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
# GNU Affero General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU Affero General Public License
15+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
#
17+
18+
package(default_visibility = ["//visibility:public"])
19+
20+
load("@vaticle_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test")
21+
22+
proto_library(
23+
name = "service-proto",
24+
srcs = [":cluster_service.proto"],
25+
deps = [
26+
":server-proto",
27+
":user-proto",
28+
":database-proto"
29+
],
30+
)
31+
32+
proto_library(
33+
name = "server-proto",
34+
srcs = [":cluster_server.proto"],
35+
)
36+
37+
proto_library(
38+
name = "user-proto",
39+
srcs = [":cluster_user.proto"],
40+
)
41+
42+
proto_library(
43+
name = "database-proto",
44+
srcs = [":cluster_database.proto"],
45+
)
46+
47+
checkstyle_test(
48+
name = "checkstyle",
49+
include = glob(["*"]),
50+
license_type = "agpl",
51+
size = "small",
52+
)

Protos/cluster/cluster_database.proto

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
//
2+
// Copyright (C) 2021 Vaticle
3+
//
4+
// This program is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU Affero General Public License as
6+
// published by the Free Software Foundation, either version 3 of the
7+
// License, or (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU Affero General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU Affero General Public License
15+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
//
17+
18+
syntax = "proto3";
19+
20+
option csharp_namespace = "GrpcServer";
21+
option java_package = "com.vaticle.typedb.protocol";
22+
option java_outer_classname = "ClusterDatabaseProto";
23+
24+
package typedb.protocol;
25+
26+
message ClusterDatabaseManager {
27+
28+
message Get {
29+
message Req {
30+
string name = 1;
31+
}
32+
message Res {
33+
ClusterDatabase database = 1;
34+
}
35+
}
36+
37+
message All {
38+
message Req {}
39+
message Res {
40+
repeated ClusterDatabase databases = 1;
41+
}
42+
}
43+
}
44+
45+
message ClusterDatabase {
46+
47+
string name = 1;
48+
repeated Replica replicas = 2;
49+
50+
message Replica {
51+
string address = 1;
52+
bool primary = 2;
53+
bool preferred = 3;
54+
int64 term = 4;
55+
}
56+
}

Protos/cluster/cluster_server.proto

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//
2+
// Copyright (C) 2021 Vaticle
3+
//
4+
// This program is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU Affero General Public License as
6+
// published by the Free Software Foundation, either version 3 of the
7+
// License, or (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU Affero General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU Affero General Public License
15+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
//
17+
18+
syntax = "proto3";
19+
20+
option csharp_namespace = "GrpcServer";
21+
option java_package = "com.vaticle.typedb.protocol";
22+
option java_outer_classname = "ClusterServerProto";
23+
24+
package typedb.protocol;
25+
26+
message ServerManager {
27+
28+
message All {
29+
message Req {}
30+
message Res {
31+
repeated Server servers = 1;
32+
}
33+
}
34+
}
35+
36+
message Server {
37+
string address = 1;
38+
}

Protos/cluster/cluster_service.proto

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
//
2+
// Copyright (C) 2021 Vaticle
3+
//
4+
// This program is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU Affero General Public License as
6+
// published by the Free Software Foundation, either version 3 of the
7+
// License, or (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU Affero General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU Affero General Public License
15+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
//
17+
18+
syntax = "proto3";
19+
20+
option csharp_namespace = "GrpcServer";
21+
option java_package = "com.vaticle.typedb.protocol";
22+
option java_outer_classname = "ClusterServiceProto";
23+
option java_generic_services = true;
24+
25+
import "cluster/cluster_server.proto";
26+
import "cluster/cluster_user.proto";
27+
import "cluster/cluster_database.proto";
28+
29+
package typedb.protocol;
30+
31+
service TypeDBCluster {
32+
33+
// Server Manager API
34+
rpc servers_all (ServerManager.All.Req) returns (ServerManager.All.Res);
35+
36+
// User Manager API
37+
rpc users_contains (ClusterUserManager.Contains.Req) returns (ClusterUserManager.Contains.Res);
38+
rpc users_create (ClusterUserManager.Create.Req) returns (ClusterUserManager.Create.Res);
39+
rpc users_all (ClusterUserManager.All.Req) returns (ClusterUserManager.All.Res);
40+
41+
// User API
42+
rpc user_password (ClusterUser.Password.Req) returns (ClusterUser.Password.Res);
43+
rpc user_delete (ClusterUser.Delete.Req) returns (ClusterUser.Delete.Res);
44+
45+
// Database Manager API
46+
rpc databases_get (ClusterDatabaseManager.Get.Req) returns (ClusterDatabaseManager.Get.Res);
47+
rpc databases_all (ClusterDatabaseManager.All.Req) returns (ClusterDatabaseManager.All.Res);
48+
}

Protos/cluster/cluster_user.proto

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
//
2+
// Copyright (C) 2021 Vaticle
3+
//
4+
// This program is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU Affero General Public License as
6+
// published by the Free Software Foundation, either version 3 of the
7+
// License, or (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU Affero General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU Affero General Public License
15+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
//
17+
18+
syntax = "proto3";
19+
20+
option csharp_namespace = "GrpcServer";
21+
option java_package = "com.vaticle.typedb.protocol";
22+
option java_outer_classname = "ClusterUserProto";
23+
24+
package typedb.protocol;
25+
26+
message ClusterUserManager {
27+
28+
message Contains {
29+
message Req {
30+
string name = 1;
31+
}
32+
message Res {
33+
bool contains = 1;
34+
}
35+
}
36+
37+
message Create {
38+
message Req {
39+
string name = 1;
40+
string password = 2;
41+
}
42+
message Res {}
43+
}
44+
45+
message All {
46+
message Req {}
47+
message Res {
48+
repeated string names = 1;
49+
}
50+
}
51+
}
52+
53+
message ClusterUser {
54+
55+
message Password {
56+
message Req {
57+
string name = 1;
58+
string password = 2;
59+
}
60+
message Res {}
61+
}
62+
63+
message Delete {
64+
message Req {
65+
string name = 1;
66+
}
67+
message Res {}
68+
}
69+
}
70+

Protos/common/BUILD

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#
2+
# Copyright (C) 2021 Vaticle
3+
#
4+
# This program is free software: you can redistribute it and/or modify
5+
# it under the terms of the GNU Affero General Public License as
6+
# published by the Free Software Foundation, either version 3 of the
7+
# License, or (at your option) any later version.
8+
#
9+
# This program is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
# GNU Affero General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU Affero General Public License
15+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
#
17+
18+
package(default_visibility = ["//visibility:public"])
19+
20+
load("@vaticle_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test")
21+
22+
proto_library(
23+
name = "answer-proto",
24+
srcs = ["answer.proto"],
25+
deps = [":concept-proto"],
26+
)
27+
28+
proto_library(
29+
name = "concept-proto",
30+
srcs = ["concept.proto"],
31+
)
32+
33+
proto_library(
34+
name = "logic-proto",
35+
srcs = ["logic.proto"],
36+
deps = [":answer-proto"]
37+
)
38+
39+
proto_library(
40+
name = "options-proto",
41+
srcs = ["options.proto"],
42+
)
43+
44+
proto_library(
45+
name = "query-proto",
46+
srcs = ["query.proto"],
47+
deps = [
48+
":answer-proto",
49+
":logic-proto",
50+
":options-proto",
51+
],
52+
)
53+
54+
proto_library(
55+
name = "session-proto",
56+
srcs = ["session.proto"],
57+
deps = [":options-proto"],
58+
)
59+
60+
proto_library(
61+
name = "transaction-proto",
62+
srcs = ["transaction.proto"],
63+
deps = [
64+
":answer-proto",
65+
":concept-proto",
66+
":logic-proto",
67+
":options-proto",
68+
":query-proto",
69+
]
70+
)
71+
72+
# TODO: THIS SHOULD BE MADE TO STOP EXISTING
73+
# This exists to support the nodejs build- when it becomes a real rule, we should extract the .src_files
74+
# from the above proto_library rules, but for now this is required to get the source files.
75+
filegroup(
76+
name = "proto-raw-buffers",
77+
srcs = [
78+
"answer.proto",
79+
"concept.proto",
80+
"options.proto",
81+
"query.proto",
82+
"session.proto",
83+
"transaction.proto",
84+
"logic.proto",
85+
]
86+
)
87+
88+
checkstyle_test(
89+
name = "checkstyle",
90+
include = glob(["*"]),
91+
license_type = "agpl",
92+
size = "small",
93+
)

0 commit comments

Comments
 (0)