0.0.10 • Published 5 months ago
badman-data-redis-starter v0.0.10
Redis MicroSoftware.
Demo API:
async main(){
await SingletonObjectFactory2.init<Logging>(Logging);
let properties:RedisStandaloneConfiguration = {
password: 'foo',
db:2,
port: 5000,
host: 'localhost'
}
let logger:Logger = SingletonObjectFactory2.Instance<Logging>(Logging.name).logger(BadmanRedis.name);
await SingletonObjectFactory2.initWithArgs(RedisTemplate,[ new IoredisConnectionFactory(properties,logger)]);
let redisTemplate:RedisTemplate = SingletonObjectFactory2.Instance(RedisTemplate.name);
logger.info(await redisTemplate.getVal('v3:demo'));
// @ts-ignore
//await redisTemplate.geoAdd('s1',['116.404352','39.876672','begin','117.404352','39.876672','end']);
logger.info(await redisTemplate.geoDist('s1','begin','end','m'));
//logger.info(await redisTemplate.geoList('s1','begin','end'));
}