github.com/mdaxf/iac@v0.0.0-20240519030858-58a061660378/engine/types/types.go (about) 1 package types 2 3 type TranCode struct { 4 ID string "json:'_id'" 5 UUID string "json:'uuid'" 6 Name string "json:'trancodename'" 7 Version string "json:'version'" 8 IsDefault bool "json:'isdefault'" 9 Status Status "json:'status'" 10 Inputs []Input "json:'inputs'" 11 Outputs []Output "json:'outputs'" 12 Functiongroups []FuncGroup "json:'functiongroups'" 13 Workflow map[string]interface{} "json:'workflow'" 14 Firstfuncgroup string "json:'firstfuncgroup'" 15 SystemData SystemData "json:'system'" 16 Description string "json:'description'" 17 TestDatas []TestData "json:'testdatas'" 18 } 19 20 type TestData struct { 21 Name string "json:'name'" 22 Inputs []Input "json:'inputs'" 23 Outputs []Output "json:'outputs'" 24 WantErr bool "json:'wanterr'" 25 WantedErr string "json:'wantederr'" 26 } 27 28 type SystemData struct { 29 CreatedBy string "json:'createdby'" 30 CreatedOn string "json:'createdon'" 31 UpdatedBy string "json:'updatedby'" 32 UpdatedOn string "json:'updatedon'" 33 } 34 35 type FuncGroup struct { 36 ID string "json:'id'" 37 Name string "json:'name'" 38 Functions []Function "json:'functions'" 39 Executionsequence string "json:'sequence'" 40 Session map[string]interface{} "json:'session'" 41 RouterDef RouterDef "json:'routerdef'" 42 functiongroupname string "json:'functiongroupname'" 43 Description string "json:'description'" 44 routing bool "json:'routing'" 45 Type string "json:'type'" 46 x int "json:'x'" 47 y int "json:'y'" 48 width int "json:'width'" 49 height int "json:'height'" 50 } 51 52 type RouterDef struct { 53 Variable string "json:'variable'" 54 Vartype string "json:'vartype'" 55 Values []string "json:'values'" 56 Nextfuncgroups []string "json:'nextfuncgroups'" 57 Defaultfuncgroup string "json:'defaultfuncgroup'" 58 } 59 60 type Function struct { 61 ID string "json:'id'" 62 Name string "json:'name'" 63 Version string "json:'version'" 64 Status Status "json:'status'" 65 Functype FunctionType "json:'functype'" 66 Inputs []Input "json:'inputs'" 67 Outputs []Output "json:'outputs'" 68 Content string "json:'content'" 69 Script string "json:'script'" 70 Mapdata map[string]interface{} "json:'mapdata'" 71 FunctionName string "json:'functionname'" 72 Description string "json:'description'" 73 Type string "json:'type'" 74 x int "json:'x'" 75 y int "json:'y'" 76 width int "json:'width'" 77 height int "json:'height'" 78 } 79 80 type Input struct { 81 ID string "json:'id'" 82 Name string "json:'name'" 83 Source InputSource "json:'source'" // 0: constant, 1: function, 2: session 84 Datatype DataType "json:'datatype'" // 0: string, 1: int, 2: float, 3: bool, 4: datetime 5: object (json) 85 Inivalue string "json:'initialvalue'" 86 Defaultvalue string "json:'defaultvalue'" 87 Value string "json:'value'" 88 List bool "json:'list'" 89 Repeat bool "json:'repeat'" 90 Aliasname string "json:'aliasname'" 91 Description string "json:'description'" 92 } 93 94 type Output struct { 95 ID string "json:'id'" 96 Name string "json:'name'" 97 Outputdest []OutputDest "json:'outputdest'" // 0:none, 1:session, 2:engine 98 Datatype DataType "json:'datatype'" // 0: string, 1: int, 2: float, 3: bool, 4: datetime 5: object (json) 99 Inivalue string "json:'initialvalue'" 100 Defaultvalue string "json:'defaultvalue'" 101 Value string "json:'value'" 102 List bool "json:'list'" 103 Aliasname []string "json:'aliasname'" 104 Description string "json:'description'" 105 } 106 107 type FunctionType int 108 109 const ( 110 InputMap FunctionType = iota 111 GoExpr 112 Javascript 113 Query 114 StoreProcedure 115 SubTranCode 116 TableInsert 117 TableUpdate 118 TableDelete 119 CollectionInsert 120 CollectionUpdate 121 CollectionDelete 122 ThrowError 123 SendMessage 124 SendEmail 125 ExplodeWorkFlow 126 StartWorkFlowTask 127 CompleteWorkFlowTask 128 SendMessagebyKafka 129 SendMessagebyMQTT 130 SendMessagebyAQMP 131 WebServiceCall 132 ) 133 134 type Status int 135 136 const ( 137 Design Status = iota 138 Test 139 Prototype 140 Production 141 ) 142 143 type DataType int 144 145 const ( 146 String DataType = iota 147 Integer 148 Float 149 Bool 150 DateTime 151 Object 152 ) 153 154 type InputSource int 155 156 const ( 157 Constant InputSource = iota 158 Prefunction 159 Fromsyssession 160 Fromusersession 161 Fromexternal 162 ) 163 164 type OutputDest int 165 166 const ( 167 None OutputDest = iota 168 Tosession 169 Toexternal 170 ) 171 172 var DateTimeFormat string = "2006-01-02 15:04:05" 173 174 const TranCodeTestProcessMessageBus string = "IAC_TRANCODE_TEST_PROCESS" 175 const TranCodeTestResultMessageBus string = "IAC_TRANCODE_TEST_RESULT"