-
Notifications
You must be signed in to change notification settings - Fork 21
/
inputParameterType.go
107 lines (101 loc) · 2.48 KB
/
inputParameterType.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package cwl
import (
//"fmt"
//"github.com/davecgh/go-spew/spew"
//"reflect"
//"strings"
)
//type InputParameterType struct {
// Type string
//}
type InputParameterType string
// func NewInputParameterType_dep(original interface{}) (ipt_ptr interface{}, err error) {
// fmt.Println("---- NewInputParameterType ----")
//
// //spew.Dump(original)
// //var ipt InputParameterType
//
// switch original.(type) {
// case []interface{}:
// original_array := original.([]interface{})
//
// array := []interface{}{}
//
// for _, v := range original_array {
// ipt, xerr := NewInputParameterType_dep(v)
// if xerr != nil {
// err = xerr
// return
// }
// array = append(array, ipt)
// }
// ipt_ptr = array
// return
//
// case map[string]interface{}:
// original_map := original.(map[string]interface{})
//
// type_value, has_type := original_map["type"]
// if !has_type {
// err = fmt.Errorf("(NewInputParameterType) type not found")
// return
// }
//
// if type_value == "array" {
// var array_schema *CommandOutputArraySchema
// array_schema, err = NewCommandOutputArraySchemaFromInterface(original_map)
// if err != nil {
// return
// }
// ipt_ptr = array_schema
// return
// } else {
// err = fmt.Errorf("(NewInputParameterType) type %s unknown", type_value)
// return
// }
//
// case string:
// original_str := original.(string)
//
// var original_type CWLType_Type
// original_type, err = NewCWLType_TypeFromString(original_str)
// if err != nil {
// err = fmt.Errorf("(NewInputParameterType) NewCWLType_TypeFromString returns %s", err.Error())
// return
// }
// ipt_ptr = original_type
// //ipt = InputParameterType(original_str)
//
// //ipt_ptr = &ipt
// return
// default:
// err = fmt.Errorf("(NewInputParameterType) type is not string: %s", reflect.TypeOf(original))
// return
// }
//
// return
// }
//func NewInputParameterTypeArray(original interface{}) (array_ptr *[]InputParameterType, err error) {
// fmt.Println("---- NewInputParameterTypeArray ----")
// spew.Dump(original)
// array := []InputParameterType{}
//
// switch original.(type) {
//
// case string:
// ipt, xerr := NewInputParameterType(original)
// if xerr != nil {
// err = xerr
// return
// }
// array = append(array, *ipt)
// array_ptr = &array
// return
// default:
//
// spew.Dump(original)
// err = fmt.Errorf("(NewInputParameterTypeArray) type %s unknown", reflect.TypeOf(original))
// return
//
// }
// }