mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
31 lines
546 B
Go
31 lines
546 B
Go
package datastore
|
|
|
|
import "github.com/kolide/kolide-ose/server/kolide"
|
|
|
|
func (orm *inmem) NewOrgInfo(info *kolide.OrgInfo) (*kolide.OrgInfo, error) {
|
|
orm.mtx.Lock()
|
|
defer orm.mtx.Unlock()
|
|
|
|
orm.orginfo = info
|
|
return info, nil
|
|
}
|
|
|
|
func (orm *inmem) OrgInfo() (*kolide.OrgInfo, error) {
|
|
orm.mtx.Lock()
|
|
defer orm.mtx.Unlock()
|
|
|
|
if orm.orginfo != nil {
|
|
return orm.orginfo, nil
|
|
}
|
|
|
|
return nil, ErrNotFound
|
|
}
|
|
|
|
func (orm *inmem) SaveOrgInfo(info *kolide.OrgInfo) error {
|
|
orm.mtx.Lock()
|
|
defer orm.mtx.Unlock()
|
|
|
|
orm.orginfo = info
|
|
return nil
|
|
}
|