()
| 299 | } |
| 300 | |
| 301 | func (p *BlockCachePacket) GetResultMsg() (m string) { |
| 302 | if p == nil { |
| 303 | return "" |
| 304 | } |
| 305 | switch p.ResultCode { |
| 306 | case proto.OpErr: |
| 307 | m = "Err: " + string(p.Data) |
| 308 | case proto.OpOk: |
| 309 | m = "Ok" |
| 310 | case proto.OpNotExistErr: |
| 311 | m = "NotExistErr" |
| 312 | default: |
| 313 | return fmt.Sprintf("Unknown ResultCode(%v)", p.ResultCode) |
| 314 | } |
| 315 | return |
| 316 | } |
| 317 | |
| 318 | func (p *BlockCachePacket) MarshalHeader(out []byte) { |
| 319 | out[0] = p.Magic |