23 lines
754 B
Go
23 lines
754 B
Go
package cache
|
|
|
|
import (
|
|
"go.uber.org/zap"
|
|
|
|
"codeberg.org/mapleopentech/monorepo/cloud/maplepress-backend/config"
|
|
"github.com/gocql/gocql"
|
|
)
|
|
|
|
// ProvideRedisCache provides a Redis cache instance
|
|
func ProvideRedisCache(cfg *config.Config, logger *zap.Logger) (RedisCacher, error) {
|
|
return NewRedisCache(cfg, logger)
|
|
}
|
|
|
|
// ProvideCassandraCache provides a Cassandra cache instance
|
|
func ProvideCassandraCache(session *gocql.Session, logger *zap.Logger) CassandraCacher {
|
|
return NewCassandraCache(session, logger)
|
|
}
|
|
|
|
// ProvideTwoTierCache provides a two-tier cache instance
|
|
func ProvideTwoTierCache(redisCache RedisCacher, cassandraCache CassandraCacher, logger *zap.Logger) TwoTierCacher {
|
|
return NewTwoTierCache(redisCache, cassandraCache, logger)
|
|
}
|