28 lines
742 B
Go
28 lines
742 B
Go
package daemon
|
|
|
|
import (
|
|
"src.dualinventive.com/go/devsim/repository"
|
|
"src.dualinventive.com/go/devsim/simulator"
|
|
)
|
|
|
|
// Daemon contains functions to provide a daemon service
|
|
type Daemon struct {
|
|
Repository repository.Service
|
|
Simulator simulator.Service
|
|
}
|
|
|
|
// New creates a new Daemon using a repository service.
|
|
func New(storage Storage, repositoryService repository.Service, smpEndpoint string, loggerDir string) *Daemon {
|
|
return &Daemon{
|
|
Repository: repositoryService,
|
|
Simulator: &simulatorService{
|
|
repService: repositoryService,
|
|
templates: make(map[string]*TemplateTracker),
|
|
simulators: make(map[string]simulator.Simulator),
|
|
smpEndpoint: smpEndpoint,
|
|
storage: storage,
|
|
loggerDir: loggerDir,
|
|
},
|
|
}
|
|
}
|