Initial commit: Open sourcing all of the Maple Open Technologies code.
This commit is contained in:
commit
755d54a99d
2010 changed files with 448675 additions and 0 deletions
23
cloud/maplefile-backend/pkg/cache/provider.go
vendored
Normal file
23
cloud/maplefile-backend/pkg/cache/provider.go
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
package cache
|
||||
|
||||
import (
|
||||
"go.uber.org/zap"
|
||||
|
||||
"codeberg.org/mapleopentech/monorepo/cloud/maplefile-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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue