chore: sync local updates

This commit is contained in:
2026-05-16 19:03:34 +08:00
parent 9c086c3301
commit 80cf54a201
89 changed files with 10622 additions and 2443 deletions

View File

@@ -0,0 +1,22 @@
package grpcrun
import (
"fmt"
"net"
"mengyamonitor-backend-server/internal/gen/mengyav1"
"mengyamonitor-backend-server/internal/ingest"
"google.golang.org/grpc"
)
// Serve starts a blocking gRPC server for agent ingest.
func Serve(listenAddr string, srv *ingest.Server) error {
lis, err := net.Listen("tcp", listenAddr)
if err != nil {
return fmt.Errorf("listen: %w", err)
}
g := grpc.NewServer()
mengyav1.RegisterAgentIngestServer(g, srv)
return g.Serve(lis)
}