MCPcopy Index your code
hub / github.com/foxcpp/maddy / configureInlineModule

Function configureInlineModule

framework/config/module/modconfig.go:71–82  ·  view source on GitHub ↗

configureInlineModule constructs "faked" config tree and passes it to module Init function to make it look like it is defined at top-level. args must contain at least one argument, otherwise configureInlineModule panics.

(modObj module.Module, args []string, globals map[string]interface{}, block config.Node)

Source from the content-addressed store, hash-verified

69//
70// args must contain at least one argument, otherwise configureInlineModule panics.
71func configureInlineModule(modObj module.Module, args []string, globals map[string]interface{}, block config.Node) error {
72 err := modObj.Configure(args, config.NewMap(globals, block))
73 if err != nil {
74 return err
75 }
76
77 if li, ok := modObj.(container.LifetimeModule); ok {
78 container.Global.Lifetime.Add(li)
79 }
80
81 return nil
82}
83
84// ModuleFromNode does all work to create or get existing module object with a certain type.
85// It is not used by top-level module definitions, only for references from other

Callers 1

ModuleFromNodeFunction · 0.85

Calls 3

NewMapFunction · 0.92
AddMethod · 0.80
ConfigureMethod · 0.65

Tested by

no test coverage detected