mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
After discussion with @groob and @marpaia, we have decided that the service methods should not be aware of any YAML/JSON definitions, and should work directly with objects. The new pattern we will use will involve converting YAML to JSON at the client, and then sending the JSON which will be decoded using the familiar go-kit mechanisms before being passed to the service methods.
20 lines
447 B
Go
20 lines
447 B
Go
package service
|
|
|
|
import (
|
|
"github.com/kolide/fleet/server/kolide"
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
func (svc service) ApplyOptionsSpec(spec *kolide.OptionsSpec) error {
|
|
err := svc.ds.ApplyOptions(spec)
|
|
return errors.Wrap(err, "apply options")
|
|
}
|
|
|
|
func (svc service) GetOptionsSpec() (*kolide.OptionsSpec, error) {
|
|
spec, err := svc.ds.GetOptions()
|
|
if err != nil {
|
|
return nil, errors.Wrap(err, "get options from datastore")
|
|
}
|
|
|
|
return spec, nil
|
|
}
|