fleet/server/datastore/inmem/app.go
2017-06-22 15:50:45 -04:00

32 lines
568 B
Go

package inmem
import "github.com/kolide/fleet/server/kolide"
func (d *Datastore) NewAppConfig(info *kolide.AppConfig) (*kolide.AppConfig, error) {
d.mtx.Lock()
defer d.mtx.Unlock()
info.ID = 1
d.appConfig = info
return info, nil
}
func (d *Datastore) AppConfig() (*kolide.AppConfig, error) {
d.mtx.Lock()
defer d.mtx.Unlock()
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()
d.appConfig = info
return nil
}