(apiJobConfig *models.ValidateJobReqV2)
| 68 | } |
| 69 | |
| 70 | func apiJobConfigToNomadJobJson(apiJobConfig *models.ValidateJobReqV2) (resJson []byte, err error) { |
| 71 | nomadJob, err := convertJobToNomadJob(true, &models.CreateOrUpdateMysqlToMysqlJobParamV2{JobId: apiJobConfig.JobId, SrcTask: apiJobConfig.SrcTaskConfig, DestTask: apiJobConfig.DestTaskConfig}) |
| 72 | if nil != err { |
| 73 | return nil, fmt.Errorf("convert mysql-to-mysql job to nomad job struct faild: %v", err) |
| 74 | } |
| 75 | |
| 76 | m := map[string]interface{}{ |
| 77 | "job": nomadJob, |
| 78 | } |
| 79 | resJson, err = json.Marshal(m) |
| 80 | if nil != err { |
| 81 | return nil, fmt.Errorf("marshal nomad job struct faild: %v", err) |
| 82 | } |
| 83 | |
| 84 | return resJson, nil |
| 85 | } |
| 86 | |
| 87 | func decryptMySQLPwd(apiSrcTask *models.SrcTaskConfig, apiDestTask *models.DestTaskConfig) (err error) { |
| 88 | // decrypt mysql password |
no test coverage detected