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)
| 69 | // |
| 70 | // args must contain at least one argument, otherwise configureInlineModule panics. |
| 71 | func 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 |
no test coverage detected