{"modulePath":"github.com/RedAFD/code-core","version":"v1.14.0-rc8","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package nosql\n\n## Functions\n\n```go\nfunc ToLevelDBURI(connection string) *url.URL\n```\nToLevelDBURI converts old style connections to a LevelDBURI\n\nA LevelDBURI matches the pattern:\n\nleveldb://path\\[?\\[option=value]\\*]\n\nWe have previously just provided the path but this prevent other options\n\n```go\nfunc ToRedisURI(connection string) *url.URL\n```\nToRedisURI converts old style connections to a RedisURI\n\nA RedisURI matches the pattern:\n\nredis://\\[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]\\*]\n\nWe 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\n\nWe need to convert this old style to the new style\n\n## Types\n\n```go\ntype Manager struct {\n\tRedisConnections   map[string]*redisClientHolder\n\tLevelDBConnections map[string]*levelDBHolder\n\t// contains filtered or unexported fields\n}\n```\nManager is the nosql connection manager\n\n```go\nfunc GetManager() *Manager\n```\nGetManager returns a Manager and initializes one as singleton is there's none yet\n\n```go\nfunc (m *Manager) CloseLevelDB(connection string) error\n```\nCloseLevelDB closes a levelDB\n\n```go\nfunc (m *Manager) CloseRedisClient(connection string) error\n```\nCloseRedisClient closes a redis client\n\n```go\nfunc (m *Manager) GetLevelDB(connection string) (*leveldb.DB, error)\n```\nGetLevelDB gets a levelDB for a particular connection\n\n```go\nfunc (m *Manager) GetRedisClient(connection string) redis.UniversalClient\n```\nGetRedisClient gets a redis client for a particular connection\n\n","path":"github.com/RedAFD/code-core/modules/nosql","name":"nosql","synopsis":"","isRedistributable":true}
