mirror of
https://github.com/lorsanstand/HomeOps-Hub.git
synced 2026-09-18 17:28:27 +03:00
refractor: hub conn
This commit is contained in:
@@ -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
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user