You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hal/parser/from_config.go

23 lines
590 B

package parser
import (
"git.jfdev.de/JonasFranzDEV/hal/hal"
)
func GetModulesFromConfig(config *hal.ClusterConfig, debug bool) (modules map[string]*hal.Module, err error) {
// all modules with their name as key
modules = make(map[string]*hal.Module)
for _, node := range config.Nodes {
program, err := ParseFile(node.Program)
if err != nil {
return nil, err
}
// By default, all IO is the standard IO, we'll override it with channels where needed.
modules[node.Name], err = hal.NewHALModule(program, 256, 4, debug)
if err != nil {
return nil, err
}
}
return
}