21 lines
516 B
Go
21 lines
516 B
Go
package setup
|
|
|
|
import (
|
|
"context"
|
|
|
|
"forge.cadoles.com/cadoles/bouncer/internal/config"
|
|
"forge.cadoles.com/cadoles/bouncer/internal/queue"
|
|
"github.com/redis/go-redis/v9"
|
|
|
|
queueRedis "forge.cadoles.com/cadoles/bouncer/internal/queue/redis"
|
|
)
|
|
|
|
func NewQueueRepository(ctx context.Context, conf config.RedisConfig) (queue.Repository, error) {
|
|
rdb := redis.NewUniversalClient(&redis.UniversalOptions{
|
|
Addrs: conf.Adresses,
|
|
MasterName: string(conf.Master),
|
|
})
|
|
|
|
return queueRedis.NewRepository(rdb), nil
|
|
}
|