Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/grafana-agent
Path: blob/main/pkg/flow/internal/controller/block_node.go
4095 views
1
package controller
2
3
import (
4
"github.com/grafana/agent/pkg/flow/internal/dag"
5
"github.com/grafana/agent/pkg/river/ast"
6
"github.com/grafana/agent/pkg/river/vm"
7
)
8
9
// BlockNode is a node in the DAG which manages a River block
10
// and can be evaluated.
11
type BlockNode interface {
12
dag.Node
13
14
// Block returns the current block of the managed config node.
15
Block() *ast.BlockStmt
16
17
// Evaluate updates the arguments for the managed component
18
// by re-evaluating its River block with the provided scope. The managed component
19
// will be built the first time Evaluate is called.
20
//
21
// Evaluate will return an error if the River block cannot be evaluated or if
22
// decoding to arguments fails.
23
Evaluate(scope *vm.Scope) error
24
}
25
26