目录
当前位置: 首页 > 文档资料 > Yearning 中文文档 >

如何启动

优质
小牛编辑
129浏览
2023-12-01
  1. 初始化Yearning
  2. 启动juno(可以通过-p 指定端口 默认端口为50001)
  3. 填写conf.toml内GrpcAddr参数(默认127.0.0.1:50001)
  4. 进行调试

注意

juno与Yearning 必须共用同一个数据库且共用同一份配置文件(如juno与Yearning不在同一台主机,则需拷贝一份cofnig.toml文件与juno放在同级目录。且Yearning项目内的config.toml文件中GrpcAddr配置项填写为juno所在主机的ip及端口)

由于当前juno仅只有linux版本,建议基于mac/windows平台开发的开发者使用docker启动juno。


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) {
    }
}