forked from p93542168/wheat-cache
feat(proto):add proto auto_tool
This commit is contained in:
parent
8bc30d3b85
commit
cf4b5cd63c
|
@ -1,7 +1,6 @@
|
||||||
syntax = "proto3";
|
syntax = "proto3";
|
||||||
import "base.proto";
|
import "base.proto";
|
||||||
option go_package = "pkg/proto";
|
option go_package = "pkg/proto";
|
||||||
|
|
||||||
message LSetRequest {
|
message LSetRequest {
|
||||||
BaseKey key = 1;
|
BaseKey key = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ message CommendResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
service CommServer {
|
service CommServer {
|
||||||
|
|
||||||
rpc Set (SetRequest) returns (CommendResponse);
|
rpc Set (SetRequest) returns (CommendResponse);
|
||||||
rpc Get (GetRequest) returns (CommendResponse);
|
rpc Get (GetRequest) returns (CommendResponse);
|
||||||
rpc Add (AddRequest) returns (CommendResponse);
|
rpc Add (AddRequest) returns (CommendResponse);
|
||||||
|
|
|
@ -24,8 +24,6 @@ def load_conf():
|
||||||
key = to_camel(key).lower()
|
key = to_camel(key).lower()
|
||||||
cfg_camel[key] = [to_camel(v) for v in val]
|
cfg_camel[key] = [to_camel(v) for v in val]
|
||||||
|
|
||||||
# print(cfg_camel)
|
|
||||||
|
|
||||||
return cfg, cfg_camel
|
return cfg, cfg_camel
|
||||||
|
|
||||||
|
|
||||||
|
@ -73,7 +71,6 @@ def mkdir(cfg_camel):
|
||||||
else: # 如果这个文件存在
|
else: # 如果这个文件存在
|
||||||
with open(proto_path) as f:
|
with open(proto_path) as f:
|
||||||
line = f.readlines()
|
line = f.readlines()
|
||||||
# print(line)
|
|
||||||
f.close()
|
f.close()
|
||||||
for v in value:
|
for v in value:
|
||||||
function = v + 'Request'
|
function = v + 'Request'
|
||||||
|
@ -109,6 +106,7 @@ def mkdir(cfg_camel):
|
||||||
file.write(l)
|
file.write(l)
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
conf, cfg_camel = load_conf()
|
conf, cfg_camel = load_conf()
|
||||||
print(cfg_camel)
|
print(cfg_camel)
|
||||||
|
|
Loading…
Reference in New Issue