21 lines
510 B
Go
21 lines
510 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 NewQueueAdapter(ctx context.Context, conf config.RedisConfig) (queue.Adapter, error) {
|
|
rdb := redis.NewUniversalClient(&redis.UniversalOptions{
|
|
Addrs: conf.Adresses,
|
|
MasterName: string(conf.Master),
|
|
})
|
|
|
|
return queueRedis.NewAdapter(rdb, 2), nil
|
|
}
|