This commit is contained in:
Jacob Gunther
2023-02-14 22:39:54 -06:00
parent 72a17b128d
commit a2605a02a7
3 changed files with 18 additions and 13 deletions

View File

@@ -3,6 +3,7 @@ package main
import (
"bytes"
"context"
"fmt"
"image"
"image/draw"
"time"
@@ -14,10 +15,12 @@ type Redis struct {
conn *redis.Client
}
func (r *Redis) Connect(uri string, database int) error {
func (r *Redis) Connect(conf RedisConfig) error {
c := redis.NewClient(&redis.Options{
Addr: uri,
DB: database,
Addr: fmt.Sprintf("%s:%d", conf.Host, conf.Port),
Username: conf.User,
Password: conf.Password,
DB: conf.Database,
})
r.conn = c