Chore: Fix goimports grouping (#62429)

* fix goimports ordering

* fix goimports order
This commit is contained in:
Serge Zaitsev
2023-01-30 09:57:50 +01:00
committed by GitHub
parent d6d4097567
commit 907e2a840e
65 changed files with 127 additions and 103 deletions

View File

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

View File

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

View File

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

View File

@@ -7,9 +7,10 @@ import (
"github.com/golang/mock/gomock"
"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/user"
"github.com/stretchr/testify/require"
)
func TestNewBroadcastRunner(t *testing.T) {

View File

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

View File

@@ -3,13 +3,13 @@ package features
import (
"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/orgchannel"
"github.com/grafana/grafana/pkg/services/live/runstream"
"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

View File

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

View File

@@ -14,6 +14,14 @@ import (
"sync"
"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/response"
"github.com/grafana/grafana/pkg/api/routing"
@@ -50,14 +58,6 @@ import (
"github.com/grafana/grafana/pkg/util"
"github.com/grafana/grafana/pkg/util/errutil"
"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 (

View File

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

View File

@@ -4,14 +4,14 @@ import (
"context"
"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/services/datasources"
"github.com/grafana/grafana/pkg/services/live/orgchannel"
"github.com/grafana/grafana/pkg/services/live/pipeline"
"github.com/grafana/grafana/pkg/services/user"
"github.com/centrifugal/centrifuge"
"github.com/grafana/grafana-plugin-sdk-go/backend"
)
type ChannelLocalPublisher struct {

View File

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

View File

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

View File

@@ -8,14 +8,14 @@ import (
"sync"
"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/data"
"github.com/grafana/grafana-plugin-sdk-go/live"
"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 (

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -3,9 +3,9 @@ package pipeline
import (
"sync"
"github.com/grafana/grafana/pkg/services/live/orgchannel"
"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.

View File

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

View File

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

View File

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

View File

@@ -3,12 +3,12 @@ package pipeline
import (
"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/model"
"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 {

View File

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

View File

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

View File

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

View File

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

View File

@@ -3,13 +3,13 @@ package pushws
import (
"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/livecontext"
"github.com/grafana/grafana/pkg/services/live/managedstream"
"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.

View File

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

View File

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

View File

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

View File

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

View File

@@ -7,9 +7,10 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/data"
"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/services/live/telemetry"
influx "github.com/influxdata/line-protocol"
)
var (