Grpc hello service implementation

This commit is contained in:
Alexander
2026-05-04 14:56:05 +02:00
parent 6baa895c6c
commit 268ee57913
14 changed files with 186 additions and 5 deletions
+27
View File
@@ -0,0 +1,27 @@
package hello
import (
"context"
pb "homelab.lan/music-agregator/gen/music_agregator/hello/v1"
)
type HelloServer struct {
pb.UnimplementedHelloServiceServer
}
func NewHelloServer() *HelloServer {
return &HelloServer{}
}
func (server *HelloServer) Ping(ctx context.Context, req *pb.PingRequest) (*pb.PongResponse, error) {
return &pb.PongResponse{}, nil
}
func (server *HelloServer) Echo(ctx context.Context, req *pb.EchoRequest) (*pb.EchoResponse, error) {
response := &pb.EchoResponse{
Response: req.GetMsg(),
}
return response, nil
}