Skip to content

Commit

Permalink
aeon: use new .proto scheme
Browse files Browse the repository at this point in the history
Update aeon-api-protos module and adjust code for it requirements.
  • Loading branch information
dmyger committed Dec 27, 2024
1 parent 243e95c commit 1ffdb70
Show file tree
Hide file tree
Showing 19 changed files with 4,888 additions and 4,154 deletions.
9 changes: 5 additions & 4 deletions cli/aeon/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type ResultError struct {
type Client struct {
title string
conn *grpc.ClientConn
client pb.AeonRouterServiceClient
client pb.SQLServiceClient
}

func makeAddress(ctx cmd.ConnectCtx) string {
Expand Down Expand Up @@ -102,13 +102,13 @@ func NewAeonHandler(ctx cmd.ConnectCtx) *Client {
if err != nil {
log.Fatalf("Fail to dial: %v", err)
}
c.client = pb.NewAeonRouterServiceClient(c.conn)

if c.ping() {
log.Infof("Aeon responses at %q", target)
} else {
log.Fatalf("Can't ping to Aeon at %q", target)
}

c.client = pb.NewSQLServiceClient(c.conn)
return &c
}

Expand All @@ -117,7 +117,8 @@ func (c *Client) ping() bool {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

_, err := c.client.Ping(ctx, &pb.PingRequest{})
diag := pb.NewDiagServiceClient(c.conn)
_, err := diag.Ping(ctx, &pb.PingRequest{})
if err != nil {
log.Warnf("Aeon ping %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cli/aeon/generate-pb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ fi

cd ${SCRIPTPATH}
rm -rf pb
protoc --go_out=. --go-grpc_out=. --proto_path=protos aeon_router.proto
protos/generate-go.sh --package ./pb --out .
Loading

0 comments on commit 1ffdb70

Please sign in to comment.