fleet/server/service/service_options.go
2017-06-22 15:50:45 -04:00

27 lines
579 B
Go

package service
import (
"context"
"github.com/kolide/fleet/server/kolide"
)
func (svc service) ResetOptions(ctx context.Context) ([]kolide.Option, error) {
return svc.ds.ResetOptions()
}
func (svc service) GetOptions(ctx context.Context) ([]kolide.Option, error) {
opts, err := svc.ds.ListOptions()
if err != nil {
return nil, err
}
return opts, nil
}
func (svc service) ModifyOptions(ctx context.Context, req kolide.OptionRequest) ([]kolide.Option, error) {
if err := svc.ds.SaveOptions(req.Options); err != nil {
return nil, err
}
return req.Options, nil
}