How to serialize GET and SET using igbinary inside go redis client

483 Views Asked by At

I have a php service and a golang service. I set the value of redis in the php service and use igbinary. How to correctly GET this value in golang service.

1

There are 1 best solutions below

5
On

igbinary of php sets a binary value, you can read the binary value into array of []byte in go.

response,err:=redisClient.Get(ctx,"key").Bytes()

here response bytes can be unmarshalled into proper struct to get values.