Skip to content

sibircevs/kredis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

KRedis

KRedis is simple Redis kotlin client.

Request-Response part is implemented now.

KRedis is EASY to use.

How do I use it?

fun main(args: Array<String>) {
    val rs = RedisClient("localhost", 6379)
    rs.connect()
    val cmd1 = cmdPing()
    println("Command Ping reply -> ${rs.execute { cmd1 }}")
    println("Command Echo reply -> ${rs.execute { cmdEcho("TEST MSG") }}")
    val cmdList = listOf<Command>(cmdPing(), cmdEcho("TEST MSG 2"))
    val rplList = cmdList.map { rs.execute { it } }
    println("Command List replies -> $rplList")
    
    val ccyList = listOf<String>("EUR", "USD", "JPY", "GBP", "RUB")
    val ccyReply = ccyList.map { cmdLPush("currency", it) }.map { rs.execute { it } }
    println("Command List replies -> $ccyReply")
    rs.close()
}

Releases

No releases published

Packages

No packages published

Languages