fleet/server/datastore/inmem/app.go

32 lines
569 B
Go
Raw Normal View History

package inmem
2017-02-01 17:20:50 +00:00
import "github.com/kolide/kolide/server/kolide"
func (d *Datastore) NewAppConfig(info *kolide.AppConfig) (*kolide.AppConfig, error) {
d.mtx.Lock()
defer d.mtx.Unlock()
info.ID = 1
2016-12-29 18:32:28 +00:00
d.appConfig = info
return info, nil
}
func (d *Datastore) AppConfig() (*kolide.AppConfig, error) {
d.mtx.Lock()
defer d.mtx.Unlock()
2016-12-29 18:32:28 +00:00
if d.appConfig != nil {
return d.appConfig, nil
}
return nil, notFound("AppConfig")
}
func (d *Datastore) SaveAppConfig(info *kolide.AppConfig) error {
d.mtx.Lock()
defer d.mtx.Unlock()
2016-12-29 18:32:28 +00:00
d.appConfig = info
return nil
}