Skip to content

Commit d4cab19

Browse files
Merge pull request #120 from sagikazarmark/remove-redis
Remove redis
2 parents 96894fb + 5a8e2ca commit d4cab19

File tree

9 files changed

+1
-151
lines changed

9 files changed

+1
-151
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ To help adopting these practices, this repository also serves as a boilerplate f
3838
- support for multiple server/daemon instances (using [oklog/run](https://github.com/oklog/run))
3939
- messaging (using [ThreeDotsLabs/watermill](https://github.com/ThreeDotsLabs/watermill))
4040
- MySQL database connection (using [go-sql-driver/mysql](https://github.com/go-sql-driver/mysql))
41-
- Redis connection (using [gomodule/redigo](https://github.com/gomodule/redigo))
41+
- ~~Redis connection (using [gomodule/redigo](https://github.com/gomodule/redigo))~~ removed due to lack of usage (see [#120](../../issues/120))
4242

4343

4444
## First steps

cmd/modern-go-application/config.go

-14
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"github.com/sagikazarmark/modern-go-application/internal/platform/database"
1414
"github.com/sagikazarmark/modern-go-application/internal/platform/log"
1515
"github.com/sagikazarmark/modern-go-application/internal/platform/opencensus"
16-
"github.com/sagikazarmark/modern-go-application/internal/platform/redis"
1716
"github.com/sagikazarmark/modern-go-application/internal/platform/watermill"
1817
)
1918

@@ -63,9 +62,6 @@ type configuration struct {
6362
// Database connection information
6463
Database database.Config
6564

66-
// Redis configuration
67-
Redis redis.Config
68-
6965
// Watermill configuration
7066
Watermill struct {
7167
RouterConfig watermill.RouterConfig
@@ -94,11 +90,6 @@ func (c configuration) Validate() error {
9490
return err
9591
}
9692

97-
// Uncomment to enable redis config validation
98-
// if err := c.Redis.Validate(); err != nil {
99-
// return err
100-
// }
101-
10293
return nil
10394
}
10495

@@ -177,11 +168,6 @@ func configure(v *viper.Viper, p *pflag.FlagSet) {
177168
"collation": "utf8mb4_general_ci",
178169
})
179170

180-
// Redis configuration
181-
_ = v.BindEnv("redis.host")
182-
v.SetDefault("redis.port", 6379)
183-
_ = v.BindEnv("redis.password")
184-
185171
// Watermill configuration
186172
v.RegisterAlias("watermill.routerConfig.closeTimeout", "shutdownTimeout")
187173
}

config.toml.dist

-5
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,3 @@ user = "root"
3333
pass = ""
3434
name = "app"
3535
params = { collation = "utf8mb4_general_ci" }
36-
37-
[redis]
38-
host = "127.0.0.1"
39-
port = 6379
40-
password = []

docker-compose.yml

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ services:
88
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
99
MYSQL_DATABASE: app
1010

11-
redis:
12-
image: redis:5.0
13-
1411
dockerhost:
1512
image: qoomon/docker-host:2.3.0
1613
cap_add: [ 'NET_ADMIN', 'NET_RAW' ]

go.mod

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ require (
1717
github.com/go-kit/kit v0.9.0
1818
github.com/go-sql-driver/mysql v1.4.1
1919
github.com/golang/protobuf v1.3.2
20-
github.com/gomodule/redigo v2.0.0+incompatible
2120
github.com/goph/idgen v0.3.0
2221
github.com/gorilla/mux v1.7.3
2322
github.com/inconshreveable/mousetrap v1.0.0 // indirect

go.sum

-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg
9595
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
9696
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
9797
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
98-
github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0=
99-
github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
10098
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
10199
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
102100
github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=

internal/platform/redis/config.go

-37
This file was deleted.

internal/platform/redis/config_test.go

-39
This file was deleted.

internal/platform/redis/pool.go

-49
This file was deleted.

0 commit comments

Comments
 (0)