Skip to content

Commit

Permalink
refactoring; fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
oke11o committed Mar 7, 2024
1 parent 5799d5d commit 68a8c52
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 14 deletions.
3 changes: 2 additions & 1 deletion components/guns/http/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ import (
"net/url"

"github.com/pkg/errors"
"go.uber.org/zap"

"github.com/yandex/pandora/core"
"github.com/yandex/pandora/core/aggregator/netsample"
"github.com/yandex/pandora/core/warmup"
"go.uber.org/zap"
)

const (
Expand Down
5 changes: 3 additions & 2 deletions components/guns/http/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ import (
"github.com/spf13/afero"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"

ammomock "github.com/yandex/pandora/components/guns/http/mocks"
"github.com/yandex/pandora/core"
"github.com/yandex/pandora/core/aggregator/netsample"
"github.com/yandex/pandora/core/coretest"
"github.com/yandex/pandora/core/engine"
"github.com/yandex/pandora/lib/monitoring"
"github.com/yandex/pandora/lib/testutil"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)

func newLogger() *zap.Logger {
Expand Down
3 changes: 2 additions & 1 deletion components/guns/http/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import (
"time"

"github.com/pkg/errors"
"github.com/yandex/pandora/lib/netutil"
"go.uber.org/zap"
"golang.org/x/net/http2"

"github.com/yandex/pandora/lib/netutil"
)

//go:generate mockery --name=Client --case=underscore --inpackage --testonly
Expand Down
3 changes: 2 additions & 1 deletion components/guns/http/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import (
"net/url"

"github.com/pkg/errors"
"github.com/yandex/pandora/lib/netutil"
"go.uber.org/zap"

"github.com/yandex/pandora/lib/netutil"
)

func NewConnectGun(cfg HTTPGunConfig, answLog *zap.Logger) *BaseGun {
Expand Down
7 changes: 4 additions & 3 deletions components/guns/http/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import (
"testing"

"github.com/stretchr/testify/require"
ammomock "github.com/yandex/pandora/components/guns/http/mocks"
"github.com/yandex/pandora/core/aggregator/netsample"
"github.com/yandex/pandora/core/config"
"go.uber.org/atomic"
"go.uber.org/zap"
"golang.org/x/net/http2"

ammomock "github.com/yandex/pandora/components/guns/http/mocks"
"github.com/yandex/pandora/core/aggregator/netsample"
"github.com/yandex/pandora/core/config"
)

func TestBaseGun_GunClientConfig_decode(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion components/guns/http/wrapper.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package phttp

import (
"github.com/yandex/pandora/core/warmup"
"net/http"

"github.com/yandex/pandora/core"
"github.com/yandex/pandora/core/aggregator/netsample"
"github.com/yandex/pandora/core/warmup"
)

//go:generate mockery --name=Ammo --case=underscore --outpkg=ammomock
Expand Down
3 changes: 2 additions & 1 deletion components/guns/http_scenario/gun.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import (
"strings"
"time"

"go.uber.org/zap"

phttp "github.com/yandex/pandora/components/guns/http"
"github.com/yandex/pandora/core"
"github.com/yandex/pandora/core/aggregator/netsample"
"go.uber.org/zap"
)

type Gun interface {
Expand Down
3 changes: 2 additions & 1 deletion components/guns/http_scenario/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import (
"net"

"github.com/spf13/afero"
"go.uber.org/zap"

phttp "github.com/yandex/pandora/components/guns/http"
"github.com/yandex/pandora/core"
"github.com/yandex/pandora/core/aggregator/netsample"
"github.com/yandex/pandora/core/register"
"github.com/yandex/pandora/lib/answlog"
"github.com/yandex/pandora/lib/netutil"
"go.uber.org/zap"
)

func WrapGun(g Gun) core.Gun {
Expand Down
3 changes: 2 additions & 1 deletion components/guns/http_scenario/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import (
"errors"
"net"

phttp "github.com/yandex/pandora/components/guns/http"
"go.uber.org/zap"

phttp "github.com/yandex/pandora/components/guns/http"
)

func NewHTTPGun(conf phttp.HTTPGunConfig, answLog *zap.Logger, targetResolved string) *BaseGun {
Expand Down
3 changes: 2 additions & 1 deletion components/phttp/import/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"net"

"github.com/spf13/afero"
"go.uber.org/zap"

phttp "github.com/yandex/pandora/components/guns/http"
scenarioGun "github.com/yandex/pandora/components/guns/http_scenario"
httpProvider "github.com/yandex/pandora/components/providers/http"
Expand All @@ -12,7 +14,6 @@ import (
"github.com/yandex/pandora/core/register"
"github.com/yandex/pandora/lib/answlog"
"github.com/yandex/pandora/lib/netutil"
"go.uber.org/zap"
)

func Import(fs afero.Fs) {
Expand Down
3 changes: 2 additions & 1 deletion tests/http_scenario/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"github.com/spf13/afero"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"go.uber.org/zap"

phttp "github.com/yandex/pandora/components/guns/http"
httpscenario "github.com/yandex/pandora/components/guns/http_scenario"
ammo "github.com/yandex/pandora/components/providers/scenario"
Expand All @@ -20,7 +22,6 @@ import (
"github.com/yandex/pandora/core/aggregator/netsample"
"github.com/yandex/pandora/core/plugin/pluginconfig"
"github.com/yandex/pandora/examples/http/server"
"go.uber.org/zap"
)

var testOnce = &sync.Once{}
Expand Down

0 comments on commit 68a8c52

Please sign in to comment.