refractor: hub conn

This commit is contained in:
2026-04-04 21:16:39 +03:00
parent 02f6bb6813
commit 602175481f
5 changed files with 61 additions and 10 deletions
+8 -4
View File
@@ -3,15 +3,19 @@ package grpc
import (
"context"
"github.com/lorsanstand/HomeOps-Hub/api/gen/homeops"
pb "github.com/lorsanstand/HomeOps-Hub/api/gen/homeops"
"google.golang.org/protobuf/types/known/emptypb"
)
type Server struct {
homeops.UnimplementedHubServer
pb.UnimplementedHubServer
}
func (s *Server) Ping(ctx context.Context, _ *emptypb.Empty) (*homeops.PongResponse, error) {
return &homeops.PongResponse{Pong: "Huiiii"}, nil
func NewServer() *Server {
return &Server{}
}
func (s *Server) Ping(ctx context.Context, _ *emptypb.Empty) (*pb.PongResponse, error) {
return &pb.PongResponse{Pong: "Pong"}, nil
}