bouncer/internal/setup/queue_repository.go

21 lines
525 B
Go
Raw Normal View History

2023-04-24 20:52:12 +02:00
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 NewQueueAdapter(ctx context.Context, redisConf config.RedisConfig) (queue.Adapter, error) {
2023-04-24 20:52:12 +02:00
rdb := redis.NewUniversalClient(&redis.UniversalOptions{
Addrs: redisConf.Adresses,
MasterName: string(redisConf.Master),
2023-04-24 20:52:12 +02:00
})
return queueRedis.NewAdapter(rdb, 2), nil
}