diff options
author | Valery Piashchynski <[email protected]> | 2020-12-01 17:33:47 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-12-01 17:33:47 +0300 |
commit | 3805b875c6498a9697c692c010bc022e8ebd50b0 (patch) | |
tree | 00635f6a6e9b1029e302f8e96faa7ab269fb43bd /plugins/http | |
parent | 84c8234ec01ad1d5ea5f0a8c7dbca9a3012bcb2b (diff) |
golangci linters fix
Diffstat (limited to 'plugins/http')
-rw-r--r-- | plugins/http/plugin.go | 10 | ||||
-rw-r--r-- | plugins/http/tests/http_test.go | 25 |
2 files changed, 17 insertions, 18 deletions
diff --git a/plugins/http/plugin.go b/plugins/http/plugin.go index 8e8957bd..79e8aa94 100644 --- a/plugins/http/plugin.go +++ b/plugins/http/plugin.go @@ -27,8 +27,8 @@ import ( ) const ( - // ID contains default service name. - ServiceName = "http" + // PluginName declares plugin name. + PluginName = "http" // EventInitSSL thrown at moment of https initialization. SSL server passed as context. EventInitSSL = 750 @@ -78,7 +78,7 @@ func (s *Plugin) AddListener(listener util.EventListener) { // misconfiguration. Services must not be used without proper configuration pushed first. func (s *Plugin) Init(cfg config.Configurer, log log.Logger, server factory.Server) error { const op = errors.Op("http Init") - err := cfg.UnmarshalKey(ServiceName, &s.cfg) + err := cfg.UnmarshalKey(PluginName, &s.cfg) if err != nil { return errors.E(op, err) } @@ -287,7 +287,7 @@ func (s *Plugin) Workers() []roadrunner.WorkerBase { } func (s *Plugin) Name() string { - return ServiceName + return PluginName } func (s *Plugin) Reset() error { @@ -298,7 +298,7 @@ func (s *Plugin) Reset() error { s.pool.Destroy(context.Background()) // re-read the config - err := s.configurer.UnmarshalKey(ServiceName, &s.cfg) + err := s.configurer.UnmarshalKey(PluginName, &s.cfg) if err != nil { return errors.E(op, err) } diff --git a/plugins/http/tests/http_test.go b/plugins/http/tests/http_test.go index 73bb53a0..06bf3f5d 100644 --- a/plugins/http/tests/http_test.go +++ b/plugins/http/tests/http_test.go @@ -41,7 +41,7 @@ var sslClient = &http.Client{ } func TestHTTPInit(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel), endure.Visualize(endure.StdOut, "")) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -104,7 +104,7 @@ func TestHTTPInit(t *testing.T) { } func TestHTTPInformerReset(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel), endure.Visualize(endure.StdOut, "")) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -225,7 +225,7 @@ func informerTest(t *testing.T) { } func TestSSL(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel), endure.Visualize(endure.StdOut, "")) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -353,7 +353,7 @@ func fcgiEcho(t *testing.T) { } func TestSSLRedirect(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel), endure.Visualize(endure.StdOut, "")) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -439,8 +439,7 @@ func sslRedirect(t *testing.T) { } func TestSSLPushPipes(t *testing.T) { - time.Sleep(time.Second) - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel), endure.Visualize(endure.StdOut, "")) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -528,7 +527,7 @@ func sslPush(t *testing.T) { } func TestFastCGI_RequestUri(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel), endure.Visualize(endure.StdOut, "")) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -612,7 +611,7 @@ func fcgiReqURI(t *testing.T) { } func TestH2CUpgrade(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel), endure.Visualize(endure.StdOut, "")) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -701,7 +700,7 @@ func h2cUpgrade(t *testing.T) { } func TestH2C(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel), endure.Visualize(endure.StdOut, "")) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -789,7 +788,7 @@ func h2c(t *testing.T) { } func TestHttpMiddleware(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel), endure.Visualize(endure.StdOut, "")) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -888,7 +887,7 @@ func middleware(t *testing.T) { } func TestHttpEchoErr(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel), endure.Visualize(endure.StdOut, "")) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -978,7 +977,7 @@ func echoError(t *testing.T) { } func TestHttpEnvVariables(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel), endure.Visualize(endure.StdOut, "")) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -1062,7 +1061,7 @@ func envVarsTest(t *testing.T) { } func TestHttpBrokenPipes(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel), endure.Visualize(endure.StdOut, "")) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) assert.NoError(t, err) cfg := &config.Viper{ |