🚚 Rename protobuf

This commit is contained in:
2024-10-21 22:07:36 +08:00
parent 80ad9399a3
commit 87a7eb8f45
31 changed files with 502 additions and 414 deletions

View File

@ -12,7 +12,7 @@ import (
)
type CommandRpcServer struct {
proto.UnimplementedCommandControllerServer
proto.UnimplementedCommandProviderServer
}
func (c CommandRpcServer) AddCommand(ctx context.Context, info *proto.CommandInfo) (*proto.AddCommandResponse, error) {
@ -66,7 +66,7 @@ func (c CommandRpcServer) SendCommand(ctx context.Context, argument *proto.Comma
ctx, cancel := context.WithTimeout(ctx, time.Second*10)
defer cancel()
out, err := proto.NewCommandControllerClient(conn).SendCommand(ctx, argument)
out, err := proto.NewCommandProviderClient(conn).SendCommand(ctx, argument)
if err != nil {
return &proto.CommandReturn{
IsDelivered: true,
@ -99,7 +99,7 @@ func (c CommandRpcServer) SendStreamCommand(g grpc.BidiStreamingServer[proto.Com
conn, err := handler.GetGrpcConn()
ctx, cancel := context.WithTimeout(g.Context(), time.Second*10)
out, err := proto.NewCommandControllerClient(conn).SendCommand(ctx, pck)
out, err := proto.NewCommandProviderClient(conn).SendCommand(ctx, pck)
cancel()
if err != nil {

View File

@ -69,7 +69,7 @@ func BroadcastEvent(event string, data any) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
_, _ = proto.NewServiceDirectoryClient(conn).BroadcastEvent(ctx, &proto.EventInfo{
_, _ = proto.NewDirectoryServiceClient(conn).BroadcastEvent(ctx, &proto.EventInfo{
Event: event,
Data: nex.EncodeMap(data),
})

View File

@ -12,7 +12,7 @@ import (
)
type ServiceRpcServer struct {
proto.UnimplementedServiceDirectoryServer
proto.UnimplementedDirectoryServiceServer
}
func instantiationService(in *ServiceInstance) *proto.ServiceInfo {