2017-08-18 15:37:33 +00:00
|
|
|
package service
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/kolide/fleet/server/kolide"
|
|
|
|
)
|
|
|
|
|
2020-04-22 21:01:34 +00:00
|
|
|
func (mw loggingMiddleware) GetFIM(ctx context.Context) (cfg *kolide.FIMConfig, err error) {
|
2017-08-18 15:37:33 +00:00
|
|
|
defer func(begin time.Time) {
|
2020-04-22 21:01:34 +00:00
|
|
|
_ = mw.loggerDebug(err).Log(
|
2017-08-18 15:37:33 +00:00
|
|
|
"method", "GetFIM",
|
|
|
|
"err", err,
|
|
|
|
"took", time.Since(begin),
|
|
|
|
)
|
|
|
|
}(time.Now())
|
2020-04-22 21:01:34 +00:00
|
|
|
cfg, err = mw.Service.GetFIM(ctx)
|
2017-08-18 15:37:33 +00:00
|
|
|
return cfg, err
|
|
|
|
}
|
|
|
|
|
2020-04-22 21:01:34 +00:00
|
|
|
func (mw loggingMiddleware) ModifyFIM(ctx context.Context, fim kolide.FIMConfig) (err error) {
|
2017-08-18 15:37:33 +00:00
|
|
|
defer func(begin time.Time) {
|
2020-04-22 21:01:34 +00:00
|
|
|
_ = mw.loggerInfo(err).Log(
|
2017-08-18 15:37:33 +00:00
|
|
|
"method", "ModifyFIM",
|
|
|
|
"err", err,
|
|
|
|
"took", time.Since(begin),
|
|
|
|
)
|
|
|
|
}(time.Now())
|
2020-04-22 21:01:34 +00:00
|
|
|
err = mw.Service.ModifyFIM(ctx, fim)
|
2017-08-18 15:37:33 +00:00
|
|
|
return err
|
|
|
|
}
|