import "code.gitea.io/gitea/modules/nosql"
leveldb.go manager.go manager_leveldb.go manager_redis.go redis.go
ToLevelDBURI converts old style connections to a LevelDBURI
A LevelDBURI matches the pattern:
leveldb://path[?[option=value]*]
We have previously just provided the path but this prevent other options
ToRedisURI converts old style connections to a RedisURI
A RedisURI matches the pattern:
redis://[username:password@]host[:port][/database][?[option=value]*] rediss://[username:password@]host[:port][/database][?[option=value]*] redis+socket://[username:password@]path[/database][?[option=value]*] redis+sentinel://[password@]host1 [: port1][, host2 [:port2]][, hostN [:portN]][/ database][?[option=value]*] redis+cluster://[password@]host1 [: port1][, host2 [:port2]][, hostN [:portN]][/ database][?[option=value]*]
We have previously used a URI like: addrs=127.0.0.1:6379 db=0 network=tcp,addr=127.0.0.1:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
We need to convert this old style to the new style
type Manager struct { RedisConnections map[string]*redisClientHolder LevelDBConnections map[string]*levelDBHolder // contains filtered or unexported fields }
Manager is the nosql connection manager
GetManager returns a Manager and initializes one as singleton is there's none yet
CloseLevelDB closes a levelDB
CloseRedisClient closes a redis client
GetLevelDB gets a levelDB for a particular connection
GetRedisClient gets a redis client for a particular connection
Package nosql imports 11 packages (graph) and is imported by 6 packages. Updated 2020-09-30. Refresh now. Tools for package owners.