From 7fac1ffb506964aebe01a765329cbd469fdac4fc Mon Sep 17 00:00:00 2001 From: soxx Date: Tue, 5 Mar 2024 21:40:42 +0100 Subject: [PATCH] feat: added ping functionality --- pkg/plug/grpc.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/plug/grpc.go b/pkg/plug/grpc.go index 178ebfc..af2148e 100644 --- a/pkg/plug/grpc.go +++ b/pkg/plug/grpc.go @@ -2,6 +2,7 @@ package plug import ( "context" + "google.golang.org/protobuf/types/known/timestamppb" "log" "git.dragse.it/anthrove/otter-space-sdk/pkg/graph" @@ -92,3 +93,11 @@ func (s *server) removeTask(taskID string) { fn() delete(s.ctx, taskID) } + +func (s *server) Ping(_ context.Context, request *gRPC.PingRequest) (*gRPC.PongResponse, error) { + response := gRPC.PongResponse{ + Message: request.Message, + Timestamp: timestamppb.Now(), + } + return &response, nil +}