circuitfactory

package
v0.15.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2022 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

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 FactoryModule

func FactoryModule() fx.Option

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.

func Module

func Module() fx.Option

Module for circuit and component factory run via the main app.

func NewComponentAndOptions

func NewComponentAndOptions(
	componentProto *policylangv1.Component,
	componentIndex int,
	policyReadAPI iface.Policy,
) (runtime.ConfiguredComponent, []runtime.ConfiguredComponent, fx.Option, error)

NewComponentAndOptions creates component and its fx options.

Types

type Circuit

type Circuit struct {
	// contains filtered or unexported fields
}

Circuit is a compiled Circuit

Circuit can also be converted to its graph view.

func CompileFromProto

func CompileFromProto(
	circuitProto []*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.CompiledComponent

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 representation of a Circuit.

type ComponentID

type ComponentID string

ComponentID is a component identifier based on position in original proto list of components.

func CreateComponents

func CreateComponents(
	circuitProto []*policylangv1.Component,
	policyReadAPI iface.Policy,
) ([]runtime.ConfiguredComponent, []ComponentID, 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 circuitProto, as some components may have their subcomponents.

func (ComponentID) ParentID

func (id ComponentID) ParentID() ComponentID

ParentID returns ID of parent component.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL