feat: added ping functionality

This commit is contained in:
SoXX 2024-03-05 21:40:42 +01:00
parent 6993c776bb
commit 7fac1ffb50

View File

@ -2,6 +2,7 @@ package plug
import ( import (
"context" "context"
"google.golang.org/protobuf/types/known/timestamppb"
"log" "log"
"git.dragse.it/anthrove/otter-space-sdk/pkg/graph" "git.dragse.it/anthrove/otter-space-sdk/pkg/graph"
@ -92,3 +93,11 @@ func (s *server) removeTask(taskID string) {
fn() fn()
delete(s.ctx, taskID) 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
}