Skip to content

Commit a8592da

Browse files
committed
Add proto files
1 parent fbfbbed commit a8592da

File tree

4 files changed

+75
-3
lines changed

4 files changed

+75
-3
lines changed

Example/Wrp.xcodeproj/project.pbxproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
571B0BDE2837E3E900F57F78 /* pbkit.wrp.example.GetSliderValueResponse.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 571B0BDA2837E3E900F57F78 /* pbkit.wrp.example.GetSliderValueResponse.pb.swift */; };
1515
571B0BE4283B55A400F57F78 /* WrpExampleServiceProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 571B0BE3283B55A400F57F78 /* WrpExampleServiceProvider.swift */; };
1616
571B0BEA283B63C100F57F78 /* pbkit.wrp.example.WrpExampleService.wrp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 571B0BE9283B63C100F57F78 /* pbkit.wrp.example.WrpExampleService.wrp.swift */; };
17+
57230F5D2844CBEE003237E5 /* wrp-example.proto in Sources */ = {isa = PBXBuildFile; fileRef = 57230F5C2844CBEE003237E5 /* wrp-example.proto */; };
1718
5740EE19283F4B7E00DF378A /* Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5740EE18283F4B7E00DF378A /* Style.swift */; };
1819
5740EE1C2840CC1C00DF378A /* ComposableArchitecture in Frameworks */ = {isa = PBXBuildFile; productRef = 5740EE1B2840CC1C00DF378A /* ComposableArchitecture */; };
1920
57D7E61528375E8F00C5F532 /* WrpApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57D7E61428375E8F00C5F532 /* WrpApp.swift */; };
@@ -30,6 +31,7 @@
3031
571B0BDA2837E3E900F57F78 /* pbkit.wrp.example.GetSliderValueResponse.pb.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = pbkit.wrp.example.GetSliderValueResponse.pb.swift; sourceTree = "<group>"; };
3132
571B0BE3283B55A400F57F78 /* WrpExampleServiceProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WrpExampleServiceProvider.swift; sourceTree = "<group>"; };
3233
571B0BE9283B63C100F57F78 /* pbkit.wrp.example.WrpExampleService.wrp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = pbkit.wrp.example.WrpExampleService.wrp.swift; sourceTree = "<group>"; };
34+
57230F5C2844CBEE003237E5 /* wrp-example.proto */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.protobuf; path = "wrp-example.proto"; sourceTree = "<group>"; };
3335
5740EE18283F4B7E00DF378A /* Style.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Style.swift; sourceTree = "<group>"; };
3436
57D7E61128375E8F00C5F532 /* WrpExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WrpExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
3537
57D7E61428375E8F00C5F532 /* WrpApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WrpApp.swift; sourceTree = "<group>"; };
@@ -100,6 +102,7 @@
100102
57D7E630283768CC00C5F532 /* Messages */ = {
101103
isa = PBXGroup;
102104
children = (
105+
57230F5C2844CBEE003237E5 /* wrp-example.proto */,
103106
571B0BD72837E3E900F57F78 /* pbkit.wrp.example.GetSliderValueRequest.pb.swift */,
104107
571B0BDA2837E3E900F57F78 /* pbkit.wrp.example.GetSliderValueResponse.pb.swift */,
105108
571B0BD92837E3E900F57F78 /* pbkit.wrp.example.GetTextValueRequest.pb.swift */,
@@ -195,6 +198,7 @@
195198
571B0BDD2837E3E900F57F78 /* pbkit.wrp.example.GetSliderValueRequest.pb.swift in Sources */,
196199
571B0BE4283B55A400F57F78 /* WrpExampleServiceProvider.swift in Sources */,
197200
571B0BDE2837E3E900F57F78 /* pbkit.wrp.example.GetSliderValueResponse.pb.swift in Sources */,
201+
57230F5D2844CBEE003237E5 /* wrp-example.proto in Sources */,
198202
571B0BDC2837E3E900F57F78 /* pbkit.wrp.example.GetTextValueRequest.pb.swift in Sources */,
199203
571B0BEA283B63C100F57F78 /* pbkit.wrp.example.WrpExampleService.wrp.swift in Sources */,
200204
5740EE19283F4B7E00DF378A /* Style.swift in Sources */,
@@ -325,7 +329,7 @@
325329
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
326330
CODE_SIGN_STYLE = Automatic;
327331
CURRENT_PROJECT_VERSION = 1;
328-
DEVELOPMENT_ASSET_PATHS = "\"Wrp/Preview Content\"";
332+
DEVELOPMENT_ASSET_PATHS = "Wrp/Preview\\ Content";
329333
DEVELOPMENT_TEAM = 299VDF7S24;
330334
ENABLE_PREVIEWS = YES;
331335
GENERATE_INFOPLIST_FILE = YES;
@@ -355,7 +359,7 @@
355359
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
356360
CODE_SIGN_STYLE = Automatic;
357361
CURRENT_PROJECT_VERSION = 1;
358-
DEVELOPMENT_ASSET_PATHS = "\"Wrp/Preview Content\"";
362+
DEVELOPMENT_ASSET_PATHS = "Wrp/Preview\\ Content";
359363
DEVELOPMENT_TEAM = 299VDF7S24;
360364
ENABLE_PREVIEWS = YES;
361365
GENERATE_INFOPLIST_FILE = YES;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
syntax = "proto3";
2+
package pbkit.wrp.example;
3+
4+
service WrpExampleService {
5+
rpc GetTextValue(GetTextValueRequest) returns (GetTextValueResponse);
6+
rpc GetSliderValue(GetSliderValueRequest) returns (stream GetSliderValueResponse);
7+
}
8+
9+
message GetTextValueRequest {}
10+
message GetTextValueResponse {
11+
string text = 1;
12+
}
13+
message GetSliderValueRequest {}
14+
message GetSliderValueResponse {
15+
int32 value = 1;
16+
}

Package.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ let package = Package(
2626
.product(name: "GRPC", package: "grpc-swift"),
2727
.product(name: "SwiftProtobuf", package: "swift-protobuf"),
2828
.product(name: "Logging", package: "swift-log"),
29-
]
29+
],
30+
exclude: ["Messages/wrp.proto"]
3031
),
3132
.testTarget(
3233
name: "WrpTests",

Sources/Wrp/Messages/wrp.proto

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
syntax = "proto3";
2+
package pbkit.wrp;
3+
4+
message WrpMessage {
5+
oneof message {
6+
WrpHostMessage_Initialize Host_Initialize = 1;
7+
WrpHostMessage_Error Host_Error = 2;
8+
WrpHostMessage_ResStart Host_ResStart = 3;
9+
WrpHostMessage_ResPayload Host_ResPayload = 4;
10+
WrpHostMessage_ResFinish Host_ResFinish = 5;
11+
WrpGuestMessage_ReqStart Guest_ReqStart = 6;
12+
WrpGuestMessage_ReqPayload Guest_ReqPayload = 7;
13+
WrpGuestMessage_ReqFinish Guest_ReqFinish = 8;
14+
WrpGuestMessage_ResFinish Guest_ResFinish = 9;
15+
}
16+
}
17+
18+
message WrpHostMessage_Initialize {
19+
repeated string available_methods = 1;
20+
}
21+
message WrpHostMessage_Error {
22+
string message = 1;
23+
}
24+
message WrpHostMessage_ResStart {
25+
string req_id = 1;
26+
map<string, string> header = 2;
27+
}
28+
message WrpHostMessage_ResPayload {
29+
string req_id = 1;
30+
bytes payload = 2;
31+
}
32+
message WrpHostMessage_ResFinish {
33+
string req_id = 1;
34+
map<string, string> trailer = 2;
35+
}
36+
37+
message WrpGuestMessage_ReqStart {
38+
string req_id = 1;
39+
string method_name = 2;
40+
map<string, string> metadata = 3;
41+
}
42+
message WrpGuestMessage_ReqPayload {
43+
string req_id = 1;
44+
bytes payload = 2;
45+
}
46+
message WrpGuestMessage_ReqFinish {
47+
string req_id = 1;
48+
}
49+
message WrpGuestMessage_ResFinish {
50+
string req_id = 1;
51+
}

0 commit comments

Comments
 (0)