forked from influxdata/kapacitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
http_out.go
32 lines (29 loc) · 926 Bytes
/
http_out.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
package pipeline
// An HTTPOutNode caches the most recent data for each group it has received.
//
// The cached data is available at the given endpoint.
// The endpoint is the relative path from the API endpoint of the running task.
// For example if the task endpoint is at "/task/<task_name>" and endpoint is
// "top10", then the data can be requested from "/task/<task_name>/top10".
//
// Example:
// stream
// |window()
// .period(10s)
// .every(5s)
// |top('value', 10)
// //Publish the top 10 results over the last 10s updated every 5s.
// |httpOut('top10')
//
type HTTPOutNode struct {
chainnode
// The relative path where the cached data is exposed
// tick:ignore
Endpoint string
}
func newHTTPOutNode(wants EdgeType, endpoint string) *HTTPOutNode {
return &HTTPOutNode{
chainnode: newBasicChainNode("http_out", wants, wants),
Endpoint: endpoint,
}
}