MCPcopy
hub / github.com/TarsCloud/TarsGo / ReadFrom

Method ReadFrom

tars/protocol/res/authf/AuthF.go:438–462  ·  view source on GitHub ↗

ReadFrom reads from readBuf and put into struct.

(readBuf *codec.Reader)

Source from the content-addressed store, hash-verified

436
437// ReadFrom reads from readBuf and put into struct.
438func (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.
465func (st *AuthRequest) ReadBlock(readBuf *codec.Reader, tag byte, require bool) error {

Callers 1

ReadBlockMethod · 0.95

Calls 3

ResetDefaultMethod · 0.95
ReadStringMethod · 0.80
ReadBlockMethod · 0.65

Tested by

no test coverage detected