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

Method ReadFrom

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

ReadFrom reads from readBuf and put into struct.

(readBuf *codec.Reader)

Source from the content-addressed store, hash-verified

893
894// ReadFrom reads from readBuf and put into struct.
895func (st *ApplyTokenResponse) ReadFrom(readBuf *codec.Reader) error {
896 var (
897 err error
898 length int32
899 have bool
900 ty byte
901 )
902 st.ResetDefault()
903
904 err = st.SKey.ReadBlock(readBuf, 1, true)
905 if err != nil {
906 return err
907 }
908
909 err = readBuf.ReadString(&st.SToken, 2, true)
910 if err != nil {
911 return err
912 }
913
914 _ = err
915 _ = length
916 _ = have
917 _ = ty
918 return nil
919}
920
921// ReadBlock reads struct from the given tag , require or optional.
922func (st *ApplyTokenResponse) 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