MCPcopy Create free account
hub / github.com/codnect/procyon / NewConditionalLoader

Function NewConditionalLoader

component/loader.go:39–49  ·  view source on GitHub ↗

NewConditionalLoader creates a ConditionalLoader with the given container and components.

(container Container, components []*Component)

Source from the content-addressed store, hash-verified

37
38// NewConditionalLoader creates a ConditionalLoader with the given container and components.
39func NewConditionalLoader(container Container, components []*Component) *ConditionalLoader {
40 if container == nil {
41 panic("nil container")
42 }
43
44 return &ConditionalLoader{
45 container: container,
46 components: components,
47 evaluator: newConditionEvaluator(container),
48 }
49}
50
51// Load evaluates the conditions of each component and registers its definition into the container
52// only if all conditions are satisfied. Components that fail condition checks are skipped.

Callers 3

TestNewConditionalLoaderFunction · 0.85
LoadMethod · 0.85

Calls 1

newConditionEvaluatorFunction · 0.85

Tested by 2

TestNewConditionalLoaderFunction · 0.68