shard.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright erfenjiao, 630166475@qq.com.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package runtime
  15. type Meta struct {
  16. RuleId string `json:"ruleId"`
  17. OpId string `json:"opId"`
  18. InstanceId int `json:"instanceId"`
  19. }
  20. type FuncMeta struct {
  21. Meta
  22. FuncId int `json:"funcId"`
  23. }
  24. type Control struct {
  25. SymbolName string `json:"symbolName"`
  26. Meta *Meta `json:"meta,omitempty"`
  27. PluginType string `json:"pluginType"`
  28. DataSource string `json:"dataSource,omitempty"`
  29. Config map[string]interface{} `json:"config,omitempty"`
  30. }
  31. type Command struct {
  32. Cmd string `json:"cmd"`
  33. Arg string `json:"arg"`
  34. }
  35. type FuncData struct {
  36. Func string `json:"func"`
  37. Arg interface{} `json:"arg"`
  38. }
  39. type FuncReply struct {
  40. State bool `json:"state"`
  41. Result interface{} `json:"result"`
  42. }
  43. type PluginMeta struct {
  44. Name string `json:"name"`
  45. Version string `json:"version"`
  46. WasmFile string `json:"wasmFile"`
  47. WasmEngine string `json:"wasmEngine"`
  48. }