mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 01:18:42 +00:00
Remove remaining uses of golang.org/x/net/context (#1464)
This commit is contained in:
parent
79d95af7c9
commit
6a3ea3fc8c
8 changed files with 13 additions and 11 deletions
|
|
@ -2,6 +2,7 @@ package cli
|
|||
|
||||
import (
|
||||
"bufio"
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
|
|
@ -13,7 +14,6 @@ import (
|
|||
"github.com/kolide/kolide/server/pubsub"
|
||||
"github.com/kolide/kolide/server/service"
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
func createPrepareCmd(configManager config.Manager) *cobra.Command {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
|
@ -25,7 +26,6 @@ import (
|
|||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
type initializer interface {
|
||||
|
|
@ -223,10 +223,11 @@ the way that the kolide server works.
|
|||
}
|
||||
}()
|
||||
go func() {
|
||||
sig := make(chan os.Signal)
|
||||
sig := make(chan os.Signal, 1)
|
||||
signal.Notify(sig, syscall.SIGINT, syscall.SIGTERM)
|
||||
<-sig //block on signal
|
||||
ctx, _ := context.WithTimeout(context.Background(), 30*time.Second)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||
defer cancel()
|
||||
errs <- srv.Shutdown(ctx)
|
||||
}()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
package kolide
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
// DecoratorStore methods to manipulate decorator queries.
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/kolide/kolide/server/kolide"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
func (mw loggingMiddleware) ListDecorators(ctx context.Context) ([]*kolide.Decorator, error) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/kolide/kolide/server/kolide"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
func (mw metricsMiddleware) ListDecorators(ctx context.Context) ([]*kolide.Decorator, error) {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/kolide/kolide/server/kolide"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
func (svc service) ListDecorators(ctx context.Context) ([]*kolide.Decorator, error) {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/kolide/kolide/server/kolide"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
func validateNewDecoratorType(payload kolide.DecoratorPayload, invalid *invalidArgumentError) {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/kolide/kolide/server/kolide"
|
||||
"github.com/kolide/kolide/server/mock"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
var dtPtr = func(t kolide.DecoratorType) *kolide.DecoratorType { return &t }
|
||||
|
|
|
|||
Loading…
Reference in a new issue