Documentation
¶
Overview ¶
Package httptrigger contains the httpTrigger node implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPTrigger ¶
HTTPTrigger is a node that triggers a workflow via HTTP. Each incoming request is injected into the running workflow as a payload; the request is answered by a downstream httpResponse node, or with a 504 error if the flow produces no response in time.
func NewHTTPTrigger ¶
func NewHTTPTrigger(node nodestore.NodeInterface, config *HTTPTriggerConfig, host nodebase.NodeHost) *HTTPTrigger
NewHTTPTrigger creates a new HTTP trigger node
func (*HTTPTrigger) Execute ¶
func (n *HTTPTrigger) Execute(ctx context.Context, input nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute starts the HTTP server to listen for incoming requests
func (*HTTPTrigger) Validate ¶
func (n *HTTPTrigger) Validate() error
Validate checks if the node is properly configured
type HTTPTriggerConfig ¶
type HTTPTriggerConfig struct {
Method string `json:"method"`
Path string `json:"path"`
Port int `json:"port"`
// Listener selects where the route is served: "own" (default)
// binds a private TCP listener on Port; "main" mounts the route
// on the host's shared HTTP server via host.SharedHTTPRouter() — the
// Node-RED model (declare a path, serve on the admin port,
// behind the admin middleware).
Listener string `json:"listener"`
// ResponseTimeout is how many seconds a request waits for a
// downstream httpResponse before a 504 is returned
// (0 = defaultResponseTimeout).
ResponseTimeout float64 `json:"responseTimeout"`
}
HTTPTriggerConfig holds configuration for the HTTP trigger node