feat: add Register agent in agent

This commit is contained in:
lorsan
2026-04-11 17:46:33 +03:00
parent c095fadc45
commit 1e05999a36
7 changed files with 230 additions and 97 deletions
+7
View File
@@ -1,9 +1,11 @@
package rpc
import (
"context"
"fmt"
pb "github.com/lorsanstand/HomeOps-Hub/api/gen/homeops"
"github.com/lorsanstand/HomeOps-Hub/internal/agent/domain"
"google.golang.org/grpc"
)
@@ -30,3 +32,8 @@ func (c *Connection) Close() error {
func (c *Connection) Hub() pb.HubClient {
return c.hub
}
func (c *Connection) RegisterAgent(ctx context.Context, RegisterData domain.RegisterAgentData) (domain.RegisterAgentDataResponse, error) {
ResponseData, err := c.Hub().RegisterAgent(ctx, new(toAgentRegisterRequest(RegisterData)))
return toAgentRegisterDataResponse(ResponseData), err
}