如何使用

  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。

调用传参

  1. syntax = "proto3";
  2. package proto;
  3. message LibraAuditOrder {
  4. string SQL = 1;
  5. string DataBase = 2;
  6. string Table = 3;
  7. bool Execute = 4;
  8. bool Check = 5;
  9. bool IsDML = 6;
  10. bool Backup = 7;
  11. Source source = 8;
  12. string WorkId = 9;
  13. bool IsAutoTask = 10;
  14. string Name = 11;
  15. }
  16. message Source {
  17. string Addr = 1;
  18. string User = 2;
  19. string Password = 3;
  20. int32 Port = 4;
  21. }
  22. message Record {
  23. string SQL = 1;
  24. int32 AffectRows = 2;
  25. string Status = 3;
  26. string Error = 4;
  27. int32 Level = 6;
  28. }
  29. message RecordSet {
  30. repeated Record record = 1;
  31. }
  32. message ExecOrder {
  33. string Message = 1;
  34. }
  35. message Isok {
  36. bool Ok = 1;
  37. }
  38. message InsulateWordList {
  39. repeated string InsulateWordList = 1;
  40. string SQL = 2;
  41. }
  42. service Juno {
  43. rpc OrderDeal (LibraAuditOrder) returns (RecordSet) {
  44. }
  45. rpc OrderDMLExec (LibraAuditOrder) returns (ExecOrder) {
  46. }
  47. rpc OrderDDLExec (LibraAuditOrder) returns (ExecOrder) {
  48. }
  49. rpc AutoTask (LibraAuditOrder) returns (Isok) {
  50. }
  51. rpc Query (LibraAuditOrder) returns (InsulateWordList) {
  52. }
  53. rpc KillOsc (LibraAuditOrder) returns (Isok) {
  54. }
  55. }