Esempio n. 1
0
// New Daemon
func New() *Daemon {
	repo := caps.NewRepository()
	err := caps.LoadBuiltInTypes(repo)
	if err != nil {
		panic(err.Error())
	}
	return &Daemon{
		tasks:   make(map[string]*Task),
		capRepo: repo,
	}
}
Esempio n. 2
0
// New Daemon
func New() *Daemon {
	db, err := asserts.OpenSysDatabase(getTrustedAccountKey())
	if err != nil {
		panic(err.Error())
	}
	repo := caps.NewRepository()
	err = caps.LoadBuiltInTypes(repo)
	if err != nil {
		panic(err.Error())
	}
	return &Daemon{
		tasks:   make(map[string]*Task),
		capRepo: repo,
		asserts: db,
	}
}
Esempio n. 3
0
// New Daemon
func New() *Daemon {
	db, err := asserts.OpenSysDatabase(getTrustedAccountKey())
	if err != nil {
		panic(err.Error())
	}
	capRepo := caps.NewRepository()
	err = caps.LoadBuiltInTypes(capRepo)
	if err != nil {
		panic(err.Error())
	}
	skillRepo := skills.NewRepository()
	err = skills.LoadBuiltInTypes(skillRepo)
	if err != nil {
		panic(err.Error())
	}
	return &Daemon{
		tasks:   make(map[string]*Task),
		capRepo: capRepo,
		skills:  skillRepo,
		// TODO: Decide when this should be disabled by default.
		enableInternalSkillActions: true,
		asserts:                    db,
	}
}