Chore: Fix goimports grouping (#62429)

* fix goimports ordering

* fix goimports order
pull/62446/head
Serge Zaitsev 2 years ago committed by GitHub
parent d6d4097567
commit 907e2a840e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      pkg/infra/filestorage/filter.go
  2. 3
      pkg/services/live/database/tests/storage_test.go
  3. 4
      pkg/services/live/features/broadcast.go
  4. 1
      pkg/services/live/features/broadcast_mock.go
  5. 3
      pkg/services/live/features/broadcast_test.go
  6. 4
      pkg/services/live/features/comment.go
  7. 6
      pkg/services/live/features/plugin.go
  8. 1
      pkg/services/live/features/plugin_mock.go
  9. 16
      pkg/services/live/live.go
  10. 4
      pkg/services/live/live_test.go
  11. 6
      pkg/services/live/liveplugin/plugin.go
  12. 1
      pkg/services/live/managedstream/cache_memory_test.go
  13. 4
      pkg/services/live/managedstream/cache_redis.go
  14. 8
      pkg/services/live/managedstream/runner.go
  15. 1
      pkg/services/live/pipeline/config.go
  16. 4
      pkg/services/live/pipeline/data_output_builtin.go
  17. 4
      pkg/services/live/pipeline/data_output_local_subscribers.go
  18. 4
      pkg/services/live/pipeline/devdata.go
  19. 4
      pkg/services/live/pipeline/frame_output_local_subscribers.go
  20. 4
      pkg/services/live/pipeline/frame_output_managed_stream.go
  21. 3
      pkg/services/live/pipeline/frame_output_remote_write.go
  22. 3
      pkg/services/live/pipeline/frame_output_remote_write_test.go
  23. 4
      pkg/services/live/pipeline/frame_storage.go
  24. 6
      pkg/services/live/pipeline/pipeline.go
  25. 1
      pkg/services/live/pipeline/pipeline_test.go
  26. 1
      pkg/services/live/pipeline/rule_builder_storage.go
  27. 6
      pkg/services/live/pipeline/subscribe_builtin.go
  28. 4
      pkg/services/live/pipeline/subscribe_managed_stream.go
  29. 1
      pkg/services/live/pipeline/subscribe_multiple.go
  30. 4
      pkg/services/live/pushhttp/push.go
  31. 4
      pkg/services/live/pushws/push_pipeline.go
  32. 6
      pkg/services/live/pushws/push_stream.go
  33. 4
      pkg/services/live/runstream/manager.go
  34. 3
      pkg/services/live/runstream/manager_test.go
  35. 1
      pkg/services/live/runstream/mock.go
  36. 1
      pkg/services/live/survey/survey.go
  37. 3
      pkg/services/live/telemetry/telegraf/convert.go
  38. 3
      pkg/services/querylibrary/tests/common.go
  39. 1
      pkg/services/searchV2/allowed_actions.go
  40. 3
      pkg/services/searchV2/http.go
  41. 7
      pkg/services/searchV2/index_test.go
  42. 1
      pkg/services/searchV2/queries.go
  43. 1
      pkg/services/searchV2/search_service_mock.go
  44. 3
      pkg/services/searchV2/service.go
  45. 4
      pkg/services/searchV2/service_bench_test.go
  46. 1
      pkg/services/searchV2/stub.go
  47. 4
      pkg/services/searchV2/types.go
  48. 5
      pkg/services/searchV2/usage.go
  49. 5
      pkg/services/store/entity/entity.pb.go
  50. 1
      pkg/services/store/entity/entity_grpc.pb.go
  51. 5
      pkg/services/store/entity/httpentitystore/service.go
  52. 7
      pkg/services/store/entity/tests/common.go
  53. 5
      pkg/services/store/k8saccess/client.go
  54. 7
      pkg/services/store/k8saccess/service.go
  55. 3
      pkg/services/store/kind/playlist/summary_test.go
  56. 3
      pkg/services/store/storage_disk.go
  57. 4
      pkg/services/store/storage_git.go
  58. 4
      pkg/services/store/storage_sql.go
  59. 2
      pkg/services/store/system_users_mock.go
  60. 3
      pkg/services/store/system_users_test.go
  61. 1
      pkg/services/store/tree.go
  62. 1
      pkg/services/store/types.go
  63. 2
      pkg/services/thumbs/crawler.go
  64. 1
      pkg/services/thumbs/datasources_lookup.go
  65. 5
      pkg/services/thumbs/datasources_lookup_test.go

@ -4,6 +4,7 @@ import (
"strings" "strings"
"github.com/armon/go-radix" "github.com/armon/go-radix"
"github.com/grafana/grafana/pkg/services/accesscontrol" "github.com/grafana/grafana/pkg/services/accesscontrol"
) )

@ -4,8 +4,9 @@ import (
"encoding/json" "encoding/json"
"testing" "testing"
"github.com/grafana/grafana/pkg/services/live/model"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/services/live/model"
) )
func TestIntegrationLiveMessage(t *testing.T) { func TestIntegrationLiveMessage(t *testing.T) {

@ -3,11 +3,11 @@ package features
import ( import (
"context" "context"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/live/model" "github.com/grafana/grafana/pkg/services/live/model"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana-plugin-sdk-go/backend"
) )
var ( var (

@ -8,6 +8,7 @@ import (
reflect "reflect" reflect "reflect"
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"
model "github.com/grafana/grafana/pkg/services/live/model" model "github.com/grafana/grafana/pkg/services/live/model"
) )

@ -7,9 +7,10 @@ import (
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/services/live/model" "github.com/grafana/grafana/pkg/services/live/model"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
"github.com/stretchr/testify/require"
) )
func TestNewBroadcastRunner(t *testing.T) { func TestNewBroadcastRunner(t *testing.T) {

@ -4,11 +4,11 @@ import (
"context" "context"
"strings" "strings"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/services/comments/commentmodel" "github.com/grafana/grafana/pkg/services/comments/commentmodel"
"github.com/grafana/grafana/pkg/services/live/model" "github.com/grafana/grafana/pkg/services/live/model"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana-plugin-sdk-go/backend"
) )
// CommentHandler manages all the `grafana/comment/*` channels. // CommentHandler manages all the `grafana/comment/*` channels.

@ -3,13 +3,13 @@ package features
import ( import (
"context" "context"
"github.com/centrifugal/centrifuge"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/services/live/model" "github.com/grafana/grafana/pkg/services/live/model"
"github.com/grafana/grafana/pkg/services/live/orgchannel" "github.com/grafana/grafana/pkg/services/live/orgchannel"
"github.com/grafana/grafana/pkg/services/live/runstream" "github.com/grafana/grafana/pkg/services/live/runstream"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
"github.com/centrifugal/centrifuge"
"github.com/grafana/grafana-plugin-sdk-go/backend"
) )
//go:generate mockgen -destination=plugin_mock.go -package=features github.com/grafana/grafana/pkg/services/live/features PluginContextGetter //go:generate mockgen -destination=plugin_mock.go -package=features github.com/grafana/grafana/pkg/services/live/features PluginContextGetter

@ -10,6 +10,7 @@ import (
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"
backend "github.com/grafana/grafana-plugin-sdk-go/backend" backend "github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
) )

@ -14,6 +14,14 @@ import (
"sync" "sync"
"time" "time"
"github.com/centrifugal/centrifuge"
"github.com/go-redis/redis/v8"
"github.com/gobwas/glob"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/live"
jsoniter "github.com/json-iterator/go"
"golang.org/x/sync/errgroup"
"github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/api/response" "github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/api/routing" "github.com/grafana/grafana/pkg/api/routing"
@ -50,14 +58,6 @@ import (
"github.com/grafana/grafana/pkg/util" "github.com/grafana/grafana/pkg/util"
"github.com/grafana/grafana/pkg/util/errutil" "github.com/grafana/grafana/pkg/util/errutil"
"github.com/grafana/grafana/pkg/web" "github.com/grafana/grafana/pkg/web"
"github.com/centrifugal/centrifuge"
"github.com/go-redis/redis/v8"
"github.com/gobwas/glob"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/live"
jsoniter "github.com/json-iterator/go"
"golang.org/x/sync/errgroup"
) )
var ( var (

@ -7,9 +7,9 @@ import (
"testing" "testing"
"time" "time"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/setting"
) )
func Test_runConcurrentlyIfNeeded_Concurrent(t *testing.T) { func Test_runConcurrentlyIfNeeded_Concurrent(t *testing.T) {

@ -4,14 +4,14 @@ import (
"context" "context"
"fmt" "fmt"
"github.com/centrifugal/centrifuge"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/plugins/plugincontext" "github.com/grafana/grafana/pkg/plugins/plugincontext"
"github.com/grafana/grafana/pkg/services/datasources" "github.com/grafana/grafana/pkg/services/datasources"
"github.com/grafana/grafana/pkg/services/live/orgchannel" "github.com/grafana/grafana/pkg/services/live/orgchannel"
"github.com/grafana/grafana/pkg/services/live/pipeline" "github.com/grafana/grafana/pkg/services/live/pipeline"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
"github.com/centrifugal/centrifuge"
"github.com/grafana/grafana-plugin-sdk-go/backend"
) )
type ChannelLocalPublisher struct { type ChannelLocalPublisher struct {

@ -6,7 +6,6 @@ import (
"testing" "testing"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )

@ -7,10 +7,10 @@ import (
"sync" "sync"
"time" "time"
"github.com/grafana/grafana/pkg/services/live/orgchannel"
"github.com/go-redis/redis/v8" "github.com/go-redis/redis/v8"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/services/live/orgchannel"
) )
// RedisFrameCache ... // RedisFrameCache ...

@ -8,14 +8,14 @@ import (
"sync" "sync"
"time" "time"
"github.com/grafana/grafana/pkg/services/live/model"
"github.com/grafana/grafana/pkg/services/live/orgchannel"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana-plugin-sdk-go/live" "github.com/grafana/grafana-plugin-sdk-go/live"
"github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/live/model"
"github.com/grafana/grafana/pkg/services/live/orgchannel"
"github.com/grafana/grafana/pkg/services/user"
) )
var ( var (

@ -2,6 +2,7 @@ package pipeline
import ( import (
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/services/org" "github.com/grafana/grafana/pkg/services/org"
) )

@ -4,10 +4,10 @@ import (
"context" "context"
"errors" "errors"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/services/live/livecontext" "github.com/grafana/grafana/pkg/services/live/livecontext"
"github.com/grafana/grafana/pkg/services/live/model" "github.com/grafana/grafana/pkg/services/live/model"
"github.com/grafana/grafana-plugin-sdk-go/backend"
) )
type BuiltinDataOutput struct { type BuiltinDataOutput struct {

@ -4,9 +4,9 @@ import (
"context" "context"
"fmt" "fmt"
"github.com/grafana/grafana/pkg/services/live/orgchannel"
"github.com/centrifugal/centrifuge" "github.com/centrifugal/centrifuge"
"github.com/grafana/grafana/pkg/services/live/orgchannel"
) )
type LocalSubscribersDataOutput struct { type LocalSubscribersDataOutput struct {

@ -10,10 +10,10 @@ import (
"os" "os"
"time" "time"
"github.com/grafana/grafana/pkg/services/live/managedstream"
"github.com/centrifugal/centrifuge" "github.com/centrifugal/centrifuge"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/services/live/managedstream"
) )
type Data struct { type Data struct {

@ -5,10 +5,10 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/grafana/grafana/pkg/services/live/orgchannel"
"github.com/centrifugal/centrifuge" "github.com/centrifugal/centrifuge"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/services/live/orgchannel"
) )
type LocalSubscribersFrameOutput struct { type LocalSubscribersFrameOutput struct {

@ -3,9 +3,9 @@ package pipeline
import ( import (
"context" "context"
"github.com/grafana/grafana/pkg/services/live/managedstream"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/services/live/managedstream"
) )
type ManagedStreamFrameOutput struct { type ManagedStreamFrameOutput struct {

@ -10,8 +10,9 @@ import (
"time" "time"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/services/live/remotewrite"
"github.com/prometheus/prometheus/prompb" "github.com/prometheus/prometheus/prompb"
"github.com/grafana/grafana/pkg/services/live/remotewrite"
) )
const flushInterval = 15 * time.Second const flushInterval = 15 * time.Second

@ -4,9 +4,8 @@ import (
"testing" "testing"
"time" "time"
"github.com/stretchr/testify/require"
"github.com/prometheus/prometheus/prompb" "github.com/prometheus/prometheus/prompb"
"github.com/stretchr/testify/require"
) )
func TestRemoteWriteFrameOutput_sample(t *testing.T) { func TestRemoteWriteFrameOutput_sample(t *testing.T) {

@ -3,9 +3,9 @@ package pipeline
import ( import (
"sync" "sync"
"github.com/grafana/grafana/pkg/services/live/orgchannel"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/services/live/orgchannel"
) )
// FrameStorage keeps last channel frame in memory. Not usable in HA setup. // FrameStorage keeps last channel frame in memory. Not usable in HA setup.

@ -6,9 +6,6 @@ import (
"fmt" "fmt"
"os" "os"
"github.com/grafana/grafana/pkg/services/live/model"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana-plugin-sdk-go/live" "github.com/grafana/grafana-plugin-sdk-go/live"
@ -19,6 +16,9 @@ import (
tracesdk "go.opentelemetry.io/otel/sdk/trace" tracesdk "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.4.0" semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
"go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/trace"
"github.com/grafana/grafana/pkg/services/live/model"
"github.com/grafana/grafana/pkg/services/user"
) )
const ( const (

@ -7,7 +7,6 @@ import (
"testing" "testing"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )

@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"github.com/centrifugal/centrifuge" "github.com/centrifugal/centrifuge"
"github.com/grafana/grafana/pkg/services/live/managedstream" "github.com/grafana/grafana/pkg/services/live/managedstream"
"github.com/grafana/grafana/pkg/services/secrets" "github.com/grafana/grafana/pkg/services/secrets"
) )

@ -3,12 +3,12 @@ package pipeline
import ( import (
"context" "context"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/live"
"github.com/grafana/grafana/pkg/services/live/livecontext" "github.com/grafana/grafana/pkg/services/live/livecontext"
"github.com/grafana/grafana/pkg/services/live/model" "github.com/grafana/grafana/pkg/services/live/model"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/live"
) )
type BuiltinSubscriber struct { type BuiltinSubscriber struct {

@ -3,11 +3,11 @@ package pipeline
import ( import (
"context" "context"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/services/live/livecontext" "github.com/grafana/grafana/pkg/services/live/livecontext"
"github.com/grafana/grafana/pkg/services/live/managedstream" "github.com/grafana/grafana/pkg/services/live/managedstream"
"github.com/grafana/grafana/pkg/services/live/model" "github.com/grafana/grafana/pkg/services/live/model"
"github.com/grafana/grafana-plugin-sdk-go/backend"
) )
type ManagedStreamSubscriber struct { type ManagedStreamSubscriber struct {

@ -4,6 +4,7 @@ import (
"context" "context"
"github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/services/live/model" "github.com/grafana/grafana/pkg/services/live/model"
) )

@ -6,14 +6,14 @@ import (
"io" "io"
"net/http" "net/http"
liveDto "github.com/grafana/grafana-plugin-sdk-go/live"
"github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/log"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model" contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
"github.com/grafana/grafana/pkg/services/live" "github.com/grafana/grafana/pkg/services/live"
"github.com/grafana/grafana/pkg/services/live/convert" "github.com/grafana/grafana/pkg/services/live/convert"
"github.com/grafana/grafana/pkg/services/live/pushurl" "github.com/grafana/grafana/pkg/services/live/pushurl"
"github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/setting"
liveDto "github.com/grafana/grafana-plugin-sdk-go/live"
"github.com/grafana/grafana/pkg/web" "github.com/grafana/grafana/pkg/web"
) )

@ -3,11 +3,11 @@ package pushws
import ( import (
"net/http" "net/http"
"github.com/gorilla/websocket"
"github.com/grafana/grafana/pkg/services/live/convert" "github.com/grafana/grafana/pkg/services/live/convert"
"github.com/grafana/grafana/pkg/services/live/livecontext" "github.com/grafana/grafana/pkg/services/live/livecontext"
"github.com/grafana/grafana/pkg/services/live/pipeline" "github.com/grafana/grafana/pkg/services/live/pipeline"
"github.com/gorilla/websocket"
) )
// PipelinePushHandler handles WebSocket client connections that push data to Live Pipeline. // PipelinePushHandler handles WebSocket client connections that push data to Live Pipeline.

@ -3,13 +3,13 @@ package pushws
import ( import (
"net/http" "net/http"
"github.com/gorilla/websocket"
liveDto "github.com/grafana/grafana-plugin-sdk-go/live"
"github.com/grafana/grafana/pkg/services/live/convert" "github.com/grafana/grafana/pkg/services/live/convert"
"github.com/grafana/grafana/pkg/services/live/livecontext" "github.com/grafana/grafana/pkg/services/live/livecontext"
"github.com/grafana/grafana/pkg/services/live/managedstream" "github.com/grafana/grafana/pkg/services/live/managedstream"
"github.com/grafana/grafana/pkg/services/live/pushurl" "github.com/grafana/grafana/pkg/services/live/pushurl"
"github.com/gorilla/websocket"
liveDto "github.com/grafana/grafana-plugin-sdk-go/live"
) )
// Handler handles WebSocket client connections that push data to Live. // Handler handles WebSocket client connections that push data to Live.

@ -8,10 +8,10 @@ import (
"sync" "sync"
"time" "time"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana-plugin-sdk-go/backend"
) )
var ( var (

@ -8,8 +8,9 @@ import (
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/services/user"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/services/user"
) )
// wait until channel closed with timeout. // wait until channel closed with timeout.

@ -10,6 +10,7 @@ import (
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"
backend "github.com/grafana/grafana-plugin-sdk-go/backend" backend "github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
) )

@ -10,6 +10,7 @@ import (
"time" "time"
"github.com/centrifugal/centrifuge" "github.com/centrifugal/centrifuge"
"github.com/grafana/grafana/pkg/services/live/managedstream" "github.com/grafana/grafana/pkg/services/live/managedstream"
) )

@ -7,9 +7,10 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana-plugin-sdk-go/data/converters" "github.com/grafana/grafana-plugin-sdk-go/data/converters"
influx "github.com/influxdata/line-protocol"
"github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/live/telemetry" "github.com/grafana/grafana/pkg/services/live/telemetry"
influx "github.com/influxdata/line-protocol"
) )
var ( var (

@ -4,6 +4,8 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/stretchr/testify/require"
apikeygenprefix "github.com/grafana/grafana/pkg/components/apikeygenprefixed" apikeygenprefix "github.com/grafana/grafana/pkg/components/apikeygenprefixed"
"github.com/grafana/grafana/pkg/server" "github.com/grafana/grafana/pkg/server"
"github.com/grafana/grafana/pkg/services/featuremgmt" "github.com/grafana/grafana/pkg/services/featuremgmt"
@ -12,7 +14,6 @@ import (
saTests "github.com/grafana/grafana/pkg/services/serviceaccounts/tests" saTests "github.com/grafana/grafana/pkg/services/serviceaccounts/tests"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/tests/testinfra" "github.com/grafana/grafana/pkg/tests/testinfra"
"github.com/stretchr/testify/require"
) )
func createServiceAccountAdminToken(t *testing.T, name string, env *server.TestEnv) (string, *user.SignedInUser) { func createServiceAccountAdminToken(t *testing.T, name string, env *server.TestEnv) (string, *user.SignedInUser) {

@ -9,6 +9,7 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/services/accesscontrol" "github.com/grafana/grafana/pkg/services/accesscontrol"
"github.com/grafana/grafana/pkg/services/dashboards" "github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/datasources" "github.com/grafana/grafana/pkg/services/datasources"

@ -7,11 +7,12 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/prometheus/client_golang/prometheus"
"github.com/grafana/grafana/pkg/api/response" "github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/api/routing" "github.com/grafana/grafana/pkg/api/routing"
"github.com/grafana/grafana/pkg/middleware" "github.com/grafana/grafana/pkg/middleware"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model" contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
"github.com/prometheus/client_golang/prometheus"
) )
type SearchHTTPService interface { type SearchHTTPService interface {

@ -6,8 +6,11 @@ import (
"path/filepath" "path/filepath"
"testing" "testing"
"github.com/blugelabs/bluge"
"github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana-plugin-sdk-go/experimental"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/tracing" "github.com/grafana/grafana/pkg/infra/tracing"
@ -15,10 +18,6 @@ import (
"github.com/grafana/grafana/pkg/services/store" "github.com/grafana/grafana/pkg/services/store"
"github.com/grafana/grafana/pkg/services/store/entity" "github.com/grafana/grafana/pkg/services/store/entity"
"github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/setting"
"github.com/blugelabs/bluge"
"github.com/grafana/grafana-plugin-sdk-go/experimental"
"github.com/stretchr/testify/require"
) )
type testDashboardLoader struct { type testDashboardLoader struct {

@ -6,6 +6,7 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/services/querylibrary" "github.com/grafana/grafana/pkg/services/querylibrary"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
) )

@ -6,7 +6,6 @@ import (
context "context" context "context"
backend "github.com/grafana/grafana-plugin-sdk-go/backend" backend "github.com/grafana/grafana-plugin-sdk-go/backend"
mock "github.com/stretchr/testify/mock" mock "github.com/stretchr/testify/mock"
user "github.com/grafana/grafana/pkg/services/user" user "github.com/grafana/grafana/pkg/services/user"

@ -10,8 +10,6 @@ import (
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promauto"
"github.com/grafana/grafana/pkg/services/querylibrary"
"github.com/grafana/grafana/pkg/infra/db" "github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/tracing" "github.com/grafana/grafana/pkg/infra/tracing"
@ -19,6 +17,7 @@ import (
"github.com/grafana/grafana/pkg/services/accesscontrol" "github.com/grafana/grafana/pkg/services/accesscontrol"
"github.com/grafana/grafana/pkg/services/featuremgmt" "github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/org" "github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/querylibrary"
"github.com/grafana/grafana/pkg/services/store" "github.com/grafana/grafana/pkg/services/store"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/setting"

@ -6,6 +6,8 @@ import (
"testing" "testing"
"time" "time"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/db" "github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/infra/tracing" "github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/services/accesscontrol/actest" "github.com/grafana/grafana/pkg/services/accesscontrol/actest"
@ -18,8 +20,6 @@ import (
"github.com/grafana/grafana/pkg/services/store" "github.com/grafana/grafana/pkg/services/store"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/require"
) )
// setupBenchEnv will set up a database with folderCount folders and dashboardsPerFolder dashboards per folder // setupBenchEnv will set up a database with folderCount folders and dashboardsPerFolder dashboards per folder

@ -5,6 +5,7 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
) )

@ -3,10 +3,10 @@ package searchV2
import ( import (
"context" "context"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/registry" "github.com/grafana/grafana/pkg/registry"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana-plugin-sdk-go/backend"
) )
type FacetField struct { type FacetField struct {

@ -6,10 +6,11 @@ import (
"github.com/blugelabs/bluge" "github.com/blugelabs/bluge"
"github.com/blugelabs/bluge/search" "github.com/blugelabs/bluge/search"
"github.com/blugelabs/bluge/search/aggregations" "github.com/blugelabs/bluge/search/aggregations"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promauto"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/tracing"
) )
type usageGauge struct { type usageGauge struct {

@ -7,10 +7,11 @@
package entity package entity
import ( import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect" reflect "reflect"
sync "sync" sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
) )
const ( const (

@ -8,6 +8,7 @@ package entity
import ( import (
context "context" context "context"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes" codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status" status "google.golang.org/grpc/status"

@ -8,6 +8,8 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/api/routing"
"github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/middleware" "github.com/grafana/grafana/pkg/middleware"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model" contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
@ -15,9 +17,6 @@ import (
"github.com/grafana/grafana/pkg/services/store/kind" "github.com/grafana/grafana/pkg/services/store/kind"
"github.com/grafana/grafana/pkg/util" "github.com/grafana/grafana/pkg/util"
"github.com/grafana/grafana/pkg/web" "github.com/grafana/grafana/pkg/web"
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/api/routing"
) )
type HTTPEntityStore interface { type HTTPEntityStore interface {

@ -4,6 +4,10 @@ import (
"context" "context"
"testing" "testing"
"github.com/stretchr/testify/require"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
apikeygenprefix "github.com/grafana/grafana/pkg/components/apikeygenprefixed" apikeygenprefix "github.com/grafana/grafana/pkg/components/apikeygenprefixed"
"github.com/grafana/grafana/pkg/infra/appcontext" "github.com/grafana/grafana/pkg/infra/appcontext"
"github.com/grafana/grafana/pkg/server" "github.com/grafana/grafana/pkg/server"
@ -14,9 +18,6 @@ import (
"github.com/grafana/grafana/pkg/services/store/entity" "github.com/grafana/grafana/pkg/services/store/entity"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/tests/testinfra" "github.com/grafana/grafana/pkg/tests/testinfra"
"github.com/stretchr/testify/require"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
) )
func createServiceAccountAdminToken(t *testing.T, env *server.TestEnv) (string, *user.SignedInUser) { func createServiceAccountAdminToken(t *testing.T, env *server.TestEnv) (string, *user.SignedInUser) {

@ -4,11 +4,12 @@ import (
"net/http" "net/http"
"net/url" "net/url"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
"github.com/grafana/grafana/pkg/web"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest" "k8s.io/client-go/rest"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
"github.com/grafana/grafana/pkg/web"
) )
type clientWrapper struct { type clientWrapper struct {

@ -4,12 +4,13 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/grafana/grafana/pkg/api/routing"
"github.com/grafana/grafana/pkg/registry"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest" "k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd"
"github.com/grafana/grafana/pkg/api/routing"
"github.com/grafana/grafana/pkg/registry"
"github.com/grafana/grafana/pkg/services/featuremgmt"
) )
type K8SAccess interface { type K8SAccess interface {

@ -5,8 +5,9 @@ import (
"encoding/json" "encoding/json"
"testing" "testing"
"github.com/grafana/grafana/pkg/kinds/playlist"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/kinds/playlist"
) )
func TestPlaylistSummary(t *testing.T) { func TestPlaylistSummary(t *testing.T) {

@ -5,8 +5,9 @@ import (
"strings" "strings"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/infra/filestorage"
"gocloud.dev/blob" "gocloud.dev/blob"
"github.com/grafana/grafana/pkg/infra/filestorage"
) )
const rootStorageTypeDisk = "disk" const rootStorageTypeDisk = "disk"

@ -11,12 +11,12 @@ import (
"github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing/object" "github.com/go-git/go-git/v5/plumbing/object"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"gocloud.dev/blob"
"github.com/grafana/grafana/pkg/infra/filestorage" "github.com/grafana/grafana/pkg/infra/filestorage"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/setting"
"gocloud.dev/blob"
) )
const rootStorageTypeGit = "git" const rootStorageTypeGit = "git"

@ -5,10 +5,10 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/infra/db" "github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/infra/filestorage" "github.com/grafana/grafana/pkg/infra/filestorage"
"github.com/grafana/grafana-plugin-sdk-go/data"
) )
const rootStorageTypeSQL = "sql" const rootStorageTypeSQL = "sql"

@ -3,9 +3,9 @@
package store package store
import ( import (
filestorage "github.com/grafana/grafana/pkg/infra/filestorage"
mock "github.com/stretchr/testify/mock" mock "github.com/stretchr/testify/mock"
filestorage "github.com/grafana/grafana/pkg/infra/filestorage"
user "github.com/grafana/grafana/pkg/services/user" user "github.com/grafana/grafana/pkg/services/user"
) )

@ -3,9 +3,10 @@ package store
import ( import (
"testing" "testing"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/filestorage" "github.com/grafana/grafana/pkg/infra/filestorage"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
"github.com/stretchr/testify/require"
) )
const admin SystemUserType = "storageAdmin" const admin SystemUserType = "storageAdmin"

@ -6,6 +6,7 @@ import (
"sync" "sync"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/infra/filestorage" "github.com/grafana/grafana/pkg/infra/filestorage"
ac "github.com/grafana/grafana/pkg/services/accesscontrol" ac "github.com/grafana/grafana/pkg/services/accesscontrol"
) )

@ -5,6 +5,7 @@ import (
"encoding/json" "encoding/json"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/infra/filestorage" "github.com/grafana/grafana/pkg/infra/filestorage"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
) )

@ -10,7 +10,6 @@ import (
"sync" "sync"
"time" "time"
"github.com/grafana/grafana/pkg/setting"
"golang.org/x/sync/errgroup" "golang.org/x/sync/errgroup"
"github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/log"
@ -18,6 +17,7 @@ import (
"github.com/grafana/grafana/pkg/services/dashboards" "github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/live" "github.com/grafana/grafana/pkg/services/live"
"github.com/grafana/grafana/pkg/services/rendering" "github.com/grafana/grafana/pkg/services/rendering"
"github.com/grafana/grafana/pkg/setting"
) )
type simpleCrawler struct { type simpleCrawler struct {

@ -7,6 +7,7 @@ import (
"fmt" "fmt"
"github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/services/featuremgmt" "github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/searchV2" "github.com/grafana/grafana/pkg/services/searchV2"
"github.com/grafana/grafana/pkg/tsdb/grafanads" "github.com/grafana/grafana/pkg/tsdb/grafanads"

@ -7,10 +7,11 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/searchV2"
"github.com/stretchr/testify/mock" "github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/searchV2"
) )
var ( var (

Loading…
Cancel
Save