Skip to content

Commit

Permalink
Merge pull request #51 from metacoma/freeplane_grpc_setnote_function
Browse files Browse the repository at this point in the history
Freeplane grpc setnote function
  • Loading branch information
metacoma authored Sep 23, 2023
2 parents b5ad7f4 + 23ffd82 commit 27fdce2
Show file tree
Hide file tree
Showing 10 changed files with 266 additions and 187 deletions.
66 changes: 35 additions & 31 deletions files/grpc/freeplane_grpc/python/freeplane_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions files/grpc/freeplane_grpc/python/freeplane_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@ class NodeDetailsSetResponse(_message.Message):
success: bool
def __init__(self, success: bool = ...) -> None: ...

class NodeNoteSetRequest(_message.Message):
__slots__ = ["node_id", "note"]
NODE_ID_FIELD_NUMBER: _ClassVar[int]
NOTE_FIELD_NUMBER: _ClassVar[int]
node_id: str
note: str
def __init__(self, node_id: _Optional[str] = ..., note: _Optional[str] = ...) -> None: ...

class NodeNoteSetResponse(_message.Message):
__slots__ = ["success"]
SUCCESS_FIELD_NUMBER: _ClassVar[int]
success: bool
def __init__(self, success: bool = ...) -> None: ...

class GroovyRequest(_message.Message):
__slots__ = ["groovy_code"]
GROOVY_CODE_FIELD_NUMBER: _ClassVar[int]
Expand Down
33 changes: 33 additions & 0 deletions files/grpc/freeplane_grpc/python/freeplane_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ def __init__(self, channel):
request_serializer=freeplane__pb2.NodeLinkSetRequest.SerializeToString,
response_deserializer=freeplane__pb2.NodeLinkSetResponse.FromString,
)
self.NodeNoteSet = channel.unary_unary(
'/freeplane.Freeplane/NodeNoteSet',
request_serializer=freeplane__pb2.NodeNoteSetRequest.SerializeToString,
response_deserializer=freeplane__pb2.NodeNoteSetResponse.FromString,
)
self.NodeDetailsSet = channel.unary_unary(
'/freeplane.Freeplane/NodeDetailsSet',
request_serializer=freeplane__pb2.NodeDetailsSetRequest.SerializeToString,
Expand Down Expand Up @@ -103,6 +108,12 @@ def NodeLinkSet(self, request, context):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def NodeNoteSet(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def NodeDetailsSet(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
Expand Down Expand Up @@ -174,6 +185,11 @@ def add_FreeplaneServicer_to_server(servicer, server):
request_deserializer=freeplane__pb2.NodeLinkSetRequest.FromString,
response_serializer=freeplane__pb2.NodeLinkSetResponse.SerializeToString,
),
'NodeNoteSet': grpc.unary_unary_rpc_method_handler(
servicer.NodeNoteSet,
request_deserializer=freeplane__pb2.NodeNoteSetRequest.FromString,
response_serializer=freeplane__pb2.NodeNoteSetResponse.SerializeToString,
),
'NodeDetailsSet': grpc.unary_unary_rpc_method_handler(
servicer.NodeDetailsSet,
request_deserializer=freeplane__pb2.NodeDetailsSetRequest.FromString,
Expand Down Expand Up @@ -292,6 +308,23 @@ def NodeLinkSet(request,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def NodeNoteSet(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/freeplane.Freeplane/NodeNoteSet',
freeplane__pb2.NodeNoteSetRequest.SerializeToString,
freeplane__pb2.NodeNoteSetResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def NodeDetailsSet(request,
target,
Expand Down
9 changes: 9 additions & 0 deletions files/grpc/freeplane_grpc/ruby/lib/freeplane_pb.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions inventory/classes/freeplane/grpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ parameters:
rpc DeleteChild (DeleteChildRequest) returns (DeleteChildResponse) {};
rpc NodeAttributeAdd (NodeAttributeAddRequest) returns (NodeAttributeAddResponse) {};
rpc NodeLinkSet (NodeLinkSetRequest) returns (NodeLinkSetResponse) {};
rpc NodeNoteSet (NodeNoteSetRequest) returns (NodeNoteSetResponse) {};
rpc NodeDetailsSet (NodeDetailsSetRequest) returns (NodeDetailsSetResponse) {};
rpc Groovy (GroovyRequest) returns (GroovyResponse) {};
rpc NodeColorSet (NodeColorSetRequest) returns (NodeColorSetResponse) {};
Expand Down Expand Up @@ -71,6 +72,15 @@ parameters:
bool success = 1;
}
message NodeNoteSetRequest {
string node_id = 1;
string note = 2;
}
message NodeNoteSetResponse {
bool success = 1;
}
message GroovyRequest {
string groovy_code = 1;
}
Expand Down
9 changes: 8 additions & 1 deletion inventory/classes/vector/tmux-bytestream-kafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ parameters:
SHELL_PID=$$
TMUX_SESSION_NAME=`tmux display-message -p '#S'`
VECTOR_UPSTREAM=`minikube ip`:${vector_aggregator_port}
TMUX_PANE_ID=`echo $TMUX_PANE | sed 's/[^0-9]//g'`
TMUX_PANE_ID=`echo $TMUX_PANE`
if [ -z "$TMUX_PANE_ID" ]; then
TMUX_PANE_ID=`tmux list-panes -t $TMUX_SESSION_NAME -F '#{pane_id} #{pane_active}' | awk '/1$/ {print $1}'`
fi
TMUX_PANE_ID=`echo $TMUX_PANE_ID | sed 's/[^0-9]//g'`
tmux pipe-pane -IO "perl ${compiled_dir}/pipe-pane2hexstream.pl | VECTOR_UPSTREAM='$VECTOR_UPSTREAM' SHELL_PID='$SHELL_PID' TMUX_SESSION_NAME='$TMUX_SESSION_NAME' TMUX_PANE_ID='$TMUX_PANE_ID' vector -q --config ${compiled_dir}/vector/tmux-bytestream.yaml"
Expand Down
4 changes: 2 additions & 2 deletions inventory/targets/freeplane_plugin_grpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ parameters:
cd ${freeplane_root}
# bash ./gRAdle.sh build
docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gradle:7-jdk17 gradle build --no-build-cache --no-configuration-cache
# docker run --rm -v "$(pwd)":/app -w /app gradle:${gradle_version}-jdk${jdk_version} gradle build
#docker run --rm -v "$(pwd)":/app -w /app gradle:${gradle_version}-jdk${jdk_version} gradle build
)
freeplane_clean: |
cd ${freeplane_root}
Expand Down Expand Up @@ -163,4 +163,4 @@ parameters:
-
|
cd grpc
cat ${kapitan_root}/files/github2/input3.json | docker run -i -v `pwd`:/host -w /host --network=host fullstorydev/grpcurl -proto ./freeplane.proto -d @ -plaintext localhost:50051 freeplane.Freeplane/MindMapFromJSON
# cat ${kapitan_root}/files/github2/input3.json | docker run -i -v `pwd`:/host -w /host --network=host fullstorydev/grpcurl -proto ./freeplane.proto -d @ -plaintext localhost:50051 freeplane.Freeplane/MindMapFromJSON
2 changes: 1 addition & 1 deletion inventory/targets/kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ parameters:
kubectl get svc -n $* --output='jsonpath="{.spec.ports[0].nodePort}"'
minikube_start: |
minikube start --driver=docker
minikube start --driver=docker --cpus max --memory max
wtf:
mods:
Expand Down
Loading

0 comments on commit 27fdce2

Please sign in to comment.