MCPcopy Create free account
hub / github.com/actiontech/dtle / convertTaskConfigMapToInternalTaskConfig

Function convertTaskConfigMapToInternalTaskConfig

api/handler/v2/job.go:1112–1121  ·  view source on GitHub ↗
(m map[string]interface{})

Source from the content-addressed store, hash-verified

1110}
1111
1112func convertTaskConfigMapToInternalTaskConfig(m map[string]interface{}) (internalConfig common.DtleTaskConfig, err error) {
1113 bs, err := json.Marshal(m)
1114 if nil != err {
1115 return common.DtleTaskConfig{}, fmt.Errorf("marshal config map failed: %v", err)
1116 }
1117 if err = json.Unmarshal(bs, &internalConfig); nil != err {
1118 return common.DtleTaskConfig{}, fmt.Errorf("unmarshal config map failed: %v", err)
1119 }
1120 return internalConfig, nil
1121}
1122
1123func buildJobDetailResp(nomadJob nomadApi.Job, nomadAllocations []nomadApi.Allocation) (destTaskDetail models.MysqlDestTaskDetail, srcTaskDetail models.SrcTaskDetail, err error) {
1124 taskGroupToNomadAlloc := make(map[string][]nomadApi.Allocation)

Callers 2

buildJobDetailRespFunction · 0.85

Calls 2

MarshalMethod · 0.65
UnmarshalMethod · 0.65

Tested by

no test coverage detected