Documentation
¶
Index ¶
- func DOT(components []*policymonitoringv1.ComponentView, ...) string
- func DecodePortMap(config any, circuitID string) (runtime.PortToSignals, error)
- func FactoryModule() fx.Option
- func FactoryModuleForPolicyApp(circuitAPI runtime.CircuitAPI) fx.Option
- func Mermaid(components []*policymonitoringv1.ComponentView, ...) string
- func Module() fx.Option
- type Circuit
- type Tree
- func CreateComponents(componentsProto []*policylangv1.Component, circuitID runtime.ComponentID, ...) (Tree, []runtime.ConfiguredComponent, fx.Option, error)
- func NewComponentAndOptions(componentProto *policylangv1.Component, componentID runtime.ComponentID, ...) (Tree, []runtime.ConfiguredComponent, fx.Option, error)
- func ParseAIMDConcurrencyController(nestedCircuitID runtime.ComponentID, ...) (Tree, []runtime.ConfiguredComponent, fx.Option, error)
- func ParseNestedCircuit(nestedCircuitID runtime.ComponentID, nestedCircuit *policylangv1.NestedCircuit, ...) (Tree, []runtime.ConfiguredComponent, fx.Option, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DOT ¶
func DOT(components []*policymonitoringv1.ComponentView, links []*policymonitoringv1.Link) string
DOT returns Components and Links as a DOT graph description.
func DecodePortMap ¶ added in v0.21.0
func DecodePortMap(config any, circuitID string) (runtime.PortToSignals, error)
DecodePortMap decodes a proto port map into a PortToSignals map.
func FactoryModule ¶
FactoryModule for component factory run via the main app.
func FactoryModuleForPolicyApp ¶
func FactoryModuleForPolicyApp(circuitAPI runtime.CircuitAPI) fx.Option
FactoryModuleForPolicyApp for component factory run via the policy app. For singletons in the Policy scope.
func Mermaid ¶
func Mermaid(components []*policymonitoringv1.ComponentView, links []*policymonitoringv1.Link) string
Mermaid returns Components and Links as a mermaid graph.
Types ¶
type Circuit ¶
type Circuit struct { Tree Tree LeafComponents []runtime.ConfiguredComponent }
Circuit is a compiled Circuit
Circuit can also be converted to its graph view.
func CompileFromProto ¶
func CompileFromProto( componentsProto []*policylangv1.Component, policyReadAPI iface.Policy, ) (*Circuit, fx.Option, error)
CompileFromProto compiles a protobuf circuit definition into a Circuit.
This is helper for CreateComponents + runtime.Compile.
func (*Circuit) Components ¶
func (circuit *Circuit) Components() []runtime.ConfiguredComponent
Components returns a list of CompiledComponents, ready to create runtime.Circuit.
func (*Circuit) ToGraphView ¶
func (circuit *Circuit) ToGraphView() ([]*policymonitoringv1.ComponentView, []*policymonitoringv1.Link)
ToGraphView creates a graph (Currently showing depth=1) representation of a Circuit.
type Tree ¶ added in v0.21.0
type Tree struct { Root runtime.ConfiguredComponent Children []Tree }
Tree is a graph view of a Circuit.
func CreateComponents ¶
func CreateComponents( componentsProto []*policylangv1.Component, circuitID runtime.ComponentID, policyReadAPI iface.Policy, ) (Tree, []runtime.ConfiguredComponent, fx.Option, error)
CreateComponents creates circuit components along with their identifiers and fx options.
Note that number of returned components might be greater than number of components in componentsProto, as some components may be composite multi-component stacks or nested circuits.
func NewComponentAndOptions ¶
func NewComponentAndOptions( componentProto *policylangv1.Component, componentID runtime.ComponentID, policyReadAPI iface.Policy, ) (Tree, []runtime.ConfiguredComponent, fx.Option, error)
NewComponentAndOptions creates parent and leaf components and their fx options for a component spec.
func ParseAIMDConcurrencyController ¶ added in v0.21.0
func ParseAIMDConcurrencyController( nestedCircuitID runtime.ComponentID, aimdConcurrencyController *policylangv1.AIMDConcurrencyController, policyReadAPI iface.Policy, ) (Tree, []runtime.ConfiguredComponent, fx.Option, error)
ParseAIMDConcurrencyController parses an AIMD concurrency controller and returns the parent, leaf components, and options.
func ParseNestedCircuit ¶ added in v0.21.0
func ParseNestedCircuit( nestedCircuitID runtime.ComponentID, nestedCircuit *policylangv1.NestedCircuit, policyReadAPI iface.Policy, ) (Tree, []runtime.ConfiguredComponent, fx.Option, error)
ParseNestedCircuit parses a nested circuit and returns the parent, leaf components, and options.