如何使用

  1. 初始化数据库 go run main.go -m
  2. 启动juno(可以通过-p 指定端口 默认端口为50001)
  3. 填写conf.toml内GrpcAddr参数(默认127.0.0.1:50001)
  4. 进行调试

调用传参


syntax = "proto3";
package proto;


message LibraAuditOrder {
    string SQL = 1;
    string DataBase = 2;
    string Table = 3;
    bool Execute = 4;
    bool Check = 5;
    bool IsDML = 6;
    bool Backup = 7;
    Source source = 8;
    string WorkId = 9;
    bool IsAutoTask = 10;
    string Name = 11;

}

message Source {
    string Addr = 1;
    string User = 2;
    string Password = 3;
    int32 Port = 4;
}

message Record {
    string SQL = 1;
    int32 AffectRows = 2;
    string Status = 3;
    string Error = 4;
    int32 Level = 6;
}

message RecordSet {
    repeated Record record = 1;
}

message ExecOrder {
    string Message = 1;
}

message Isok {
    bool Ok = 1;
}
message InsulateWordList {
    repeated string InsulateWordList = 1;
    string SQL = 2;
}

service Juno {
    rpc OrderDeal (LibraAuditOrder) returns (RecordSet) {
    }
    rpc OrderDMLExec (LibraAuditOrder) returns (ExecOrder) {
    }
    rpc OrderDDLExec (LibraAuditOrder) returns (ExecOrder) {
    }
    rpc AutoTask (LibraAuditOrder) returns (Isok) {
    }
    rpc Query (LibraAuditOrder) returns (InsulateWordList) {
    }
    rpc KillOsc (LibraAuditOrder) returns (Isok) {
    }
}

results matching ""

    No results matching ""