Compare commits

...

2 Commits

Author SHA1 Message Date
e8ea4ff1dd update go version 2021-01-30 20:39:36 -05:00
9ac16ae71e Add optional redis password 2021-01-30 20:34:36 -05:00
2 changed files with 17 additions and 9 deletions

View File

@ -1,5 +1,5 @@
# Build
FROM golang:1.13 as go_build
FROM golang:1.15 as go_build
WORKDIR /build/
COPY main.go .

24
main.go
View File

@ -23,13 +23,14 @@ var pool *pgx.ConnPool
var replacer = strings.NewReplacer(".", "_")
type FeedArchiverArgs struct {
DbHost string
DbUser string
DbPassword string
DbDatabase string
RedisAddr string
Pattern string
Threads int
DbHost string
DbUser string
DbPassword string
DbDatabase string
RedisAddr string
RedisPassword string
Pattern string
Threads int
}
func main() {
@ -74,6 +75,13 @@ func main() {
Value: "localhost:6379",
EnvVars: []string{"FA_REDIS_ADDR"},
},
&cli.StringFlag{
Name: "redis-password",
Usage: "Redis password",
Destination: &args.RedisPassword,
Value: "",
EnvVars: []string{"FA_REDIS_PASSWORD"},
},
&cli.StringFlag{
Name: "pattern",
Usage: "redis arc pattern",
@ -113,7 +121,7 @@ func main() {
rdb := redis.NewClient(&redis.Options{
Addr: args.RedisAddr,
Password: "",
Password: args.RedisPassword,
DB: 0,
})