Files
herolib/lib/data/resp
Mahmoud-Emad 92c8a3b955 fix: improve Redis response parsing and error handling
- Add error handling for non-array and error responses
- Introduce `strget()` for safer string conversion from RValue
- Update AGE client to use `strget()` for key retrieval
- Change AGE verify methods to expect a string response
- Handle multiple response types when listing AGE keys
2025-09-14 18:15:23 +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
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) }
}