ReadFrom reads from readBuf and put into struct.
(readBuf *codec.Reader)
| 436 | |
| 437 | // ReadFrom reads from readBuf and put into struct. |
| 438 | func (st *AuthRequest) ReadFrom(readBuf *codec.Reader) error { |
| 439 | var ( |
| 440 | err error |
| 441 | length int32 |
| 442 | have bool |
| 443 | ty byte |
| 444 | ) |
| 445 | st.ResetDefault() |
| 446 | |
| 447 | err = st.SKey.ReadBlock(readBuf, 1, true) |
| 448 | if err != nil { |
| 449 | return err |
| 450 | } |
| 451 | |
| 452 | err = readBuf.ReadString(&st.SToken, 2, true) |
| 453 | if err != nil { |
| 454 | return err |
| 455 | } |
| 456 | |
| 457 | _ = err |
| 458 | _ = length |
| 459 | _ = have |
| 460 | _ = ty |
| 461 | return nil |
| 462 | } |
| 463 | |
| 464 | // ReadBlock reads struct from the given tag , require or optional. |
| 465 | func (st *AuthRequest) ReadBlock(readBuf *codec.Reader, tag byte, require bool) error { |
no test coverage detected