Files
herolib/lib/data/resp
2025-10-12 12:30:19 +03:00
..
2024-12-25 09:23:31 +01:00
2024-12-25 09:23:31 +01:00
2024-12-25 09:23:31 +01:00
2024-12-25 09:23:31 +01:00
2024-12-25 09:23:31 +01:00

redis serialization protocol

example

module main
import resp
import crypto.ed25519

fn do()?{
	mut b := resp.builder_new()
	b.add(resp.r_list_string(['a', 'b']))
	b.add(resp.r_int(10))
	b.add(resp.r_ok())
	//to get some binary
	pubkey,privkey := ed25519.generate_key()?

	b.add(resp.r_bytestring(privkey))

	//b.data now has the info as binary data
	// println(b.data)
	println(b.data.bytestr())

	lr := resp.decode(b.data)?
	println(lr)
		
}


fn main(){
	do() or { panic(err) }
}