summaryrefslogtreecommitdiff
path: root/service/gzip
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-11 13:00:52 +0300
committerValery Piashchynski <[email protected]>2021-01-11 13:00:52 +0300
commitc4112cd214a9c7cbed82c82eefc75904fb42d1af (patch)
tree680cc5f0d3f9a0d78a944e026568af61c12bd87e /service/gzip
parent5dc83ef5eee77f4d1ef557e5f8b566e75892680d (diff)
Update CI
Format imports and code Distinct internal and app errors
Diffstat (limited to 'service/gzip')
-rw-r--r--service/gzip/config_test.go5
-rw-r--r--service/gzip/service.go4
-rw-r--r--service/gzip/service_test.go3
3 files changed, 8 insertions, 4 deletions
diff --git a/service/gzip/config_test.go b/service/gzip/config_test.go
index c2168166..8d03aecf 100644
--- a/service/gzip/config_test.go
+++ b/service/gzip/config_test.go
@@ -1,15 +1,16 @@
package gzip
import (
+ "testing"
+
json "github.com/json-iterator/go"
"github.com/spiral/roadrunner/service"
"github.com/stretchr/testify/assert"
- "testing"
)
type mockCfg struct{ cfg string }
-func (cfg *mockCfg) Get(name string) service.Config { return nil }
+func (cfg *mockCfg) Get(name string) service.Config { return nil }
func (cfg *mockCfg) Unmarshal(out interface{}) error {
j := json.ConfigCompatibleWithStandardLibrary
return j.Unmarshal([]byte(cfg.cfg), out)
diff --git a/service/gzip/service.go b/service/gzip/service.go
index 231ba4d9..2ba95158 100644
--- a/service/gzip/service.go
+++ b/service/gzip/service.go
@@ -2,13 +2,15 @@ package gzip
import (
"errors"
+ "net/http"
+
"github.com/NYTimes/gziphandler"
rrhttp "github.com/spiral/roadrunner/service/http"
- "net/http"
)
// ID contains default service name.
const ID = "gzip"
+
var httpNotInitialized = errors.New("http service should be defined properly in config to use gzip")
type Service struct {
diff --git a/service/gzip/service_test.go b/service/gzip/service_test.go
index 778bdacd..d886a339 100644
--- a/service/gzip/service_test.go
+++ b/service/gzip/service_test.go
@@ -1,13 +1,14 @@
package gzip
import (
+ "testing"
+
json "github.com/json-iterator/go"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus/hooks/test"
"github.com/spiral/roadrunner/service"
rrhttp "github.com/spiral/roadrunner/service/http"
"github.com/stretchr/testify/assert"
- "testing"
)
type testCfg struct {