mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
25 lines
453 B
Go
25 lines
453 B
Go
package blueprint
|
|
|
|
type Blueprint struct {
|
|
execPool ExecPool
|
|
graphPool GraphPool
|
|
}
|
|
|
|
func (bm *Blueprint) Init(execDefFilePath string, graphFilePath string, onRegister func(execPool *ExecPool) error) error {
|
|
err := bm.execPool.Load(execDefFilePath)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = onRegister(&bm.execPool)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = bm.graphPool.Load(&bm.execPool, graphFilePath)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|