mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
规则引擎
This commit is contained in:
26
pkg/rule_engine/nodes/external_restapi_node.go
Normal file
26
pkg/rule_engine/nodes/external_restapi_node.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package nodes
|
||||
|
||||
type externalRestapiNode struct {
|
||||
bareNode
|
||||
RestEndpointUrlPattern string
|
||||
RequestMethod string
|
||||
headers map[string]string
|
||||
UseSimpleClientHttpFactory bool
|
||||
ReadTimeoutMs int
|
||||
MaxParallelRequestsCount int
|
||||
UseRedisQueueForMsgPersistence bool
|
||||
trimQueue bool
|
||||
MaxQueueSize int
|
||||
}
|
||||
|
||||
type externalRestapiNodeFactory struct{}
|
||||
|
||||
func (f externalRestapiNodeFactory) Name() string { return "ExternalRestapiNode" }
|
||||
func (f externalRestapiNodeFactory) Category() string { return NODE_CATEGORY_EXTERNAL }
|
||||
func (f externalRestapiNodeFactory) Create(id string, meta Metadata) (Node, error) {
|
||||
labels := []string{"True", "False"}
|
||||
node := &externalRestapiNode{
|
||||
bareNode: newBareNode(f.Name(), id, meta, labels),
|
||||
}
|
||||
return decodePath(meta, node)
|
||||
}
|
||||
Reference in New Issue
Block a user