Start adding support for writing measurements to disk

This commit is contained in:
Arturo Filastò
2018-03-19 13:20:42 +01:00
parent efb7e87d1b
commit 90c1c2de87
4 changed files with 52 additions and 18 deletions
+10 -6
View File
@@ -37,15 +37,15 @@ func init() {
}
Init = func() (*ooni.Config, *ooni.Context, error) {
var c *ooni.Config
var config *ooni.Config
var err error
if *configPath != "" {
log.Debugf("Reading config file from %s", *configPath)
c, err = ooni.ReadConfig(*configPath)
config, err = ooni.ReadConfig(*configPath)
} else {
log.Debug("Reading default config file")
c, err = ooni.ReadDefaultConfigPaths()
config, err = ooni.ReadDefaultConfigPaths()
}
if err != nil {
return nil, nil, err
@@ -62,9 +62,13 @@ func init() {
return nil, nil, err
}
o := ooni.New(c, db)
o.Init()
return c, o, nil
ctx := ooni.New(config, db)
err = ctx.Init()
if err != nil {
return nil, nil, err
}
return config, ctx, nil
}
return nil