🚚 Rename protobuf
This commit is contained in:
@ -22,7 +22,7 @@ func GetCommandKey(id, method string) string {
|
||||
|
||||
func (v *Conn) AddCommand(id, method string, tags []string, fn CommandHandler) error {
|
||||
method = strings.ToLower(method)
|
||||
dir := proto.NewCommandControllerClient(v.nexusConn)
|
||||
dir := proto.NewCommandProviderClient(v.nexusConn)
|
||||
ctx := context.Background()
|
||||
ctx = metadata.AppendToOutgoingContext(ctx, "client_id", v.Info.Id)
|
||||
|
||||
@ -53,7 +53,7 @@ func (v *Conn) AddCommand(id, method string, tags []string, fn CommandHandler) e
|
||||
type localCommandRpcServer struct {
|
||||
conn *Conn
|
||||
|
||||
proto.UnimplementedCommandControllerServer
|
||||
proto.UnimplementedCommandProviderServer
|
||||
health.UnimplementedHealthServer
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ func (v localCommandRpcServer) Watch(request *health.HealthCheckRequest, server
|
||||
func (v *Conn) RunCommands(addr string) error {
|
||||
v.commandServer = grpc.NewServer()
|
||||
service := &localCommandRpcServer{conn: v}
|
||||
proto.RegisterCommandControllerServer(v.commandServer, service)
|
||||
proto.RegisterCommandProviderServer(v.commandServer, service)
|
||||
health.RegisterHealthServer(v.commandServer, service)
|
||||
reflection.Register(v.commandServer)
|
||||
|
||||
|
@ -45,7 +45,7 @@ func NewNexusConn(addr string, info *proto.ServiceInfo) (*Conn, error) {
|
||||
}
|
||||
|
||||
func (v *Conn) RegisterService() error {
|
||||
dir := proto.NewServiceDirectoryClient(v.nexusConn)
|
||||
dir := proto.NewDirectoryServiceClient(v.nexusConn)
|
||||
ctx := context.Background()
|
||||
ctx = metadata.AppendToOutgoingContext(ctx, "client_id", v.Info.Id)
|
||||
_, err := dir.AddService(ctx, v.Info)
|
||||
@ -91,7 +91,7 @@ func (v *Conn) GetClientGrpcConn(t string) (*grpc.ClientConn, error) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
|
||||
defer cancel()
|
||||
|
||||
out, err := proto.NewServiceDirectoryClient(v.nexusConn).GetService(ctx, &proto.GetServiceRequest{
|
||||
out, err := proto.NewDirectoryServiceClient(v.nexusConn).GetService(ctx, &proto.GetServiceRequest{
|
||||
Type: &t,
|
||||
})
|
||||
if err != nil {
|
||||
|
@ -13,7 +13,7 @@ func (v *CrudConn) AllocDatabase(name string) (string, error) {
|
||||
conn := v.Conn.GetNexusGrpcConn()
|
||||
ctx := context.Background()
|
||||
ctx = metadata.AppendToOutgoingContext(ctx, "client_id", v.Conn.Info.Id)
|
||||
out, err := proto.NewDatabaseControllerClient(conn).AllocDatabase(ctx, &proto.AllocDatabaseRequest{
|
||||
out, err := proto.NewDatabaseServiceClient(conn).AllocDatabase(ctx, &proto.AllocDatabaseRequest{
|
||||
Name: name,
|
||||
})
|
||||
if err != nil || !out.GetIsSuccess() {
|
||||
|
Reference in New Issue
Block a user