MCPcopy Create free account
hub / github.com/1buran/rHttp / Load

Method Load

session.go:88–106  ·  view source on GitHub ↗

Load the session.

(r io.ReadCloser)

Source from the content-addressed store, hash-verified

86
87// Load the session.
88func (s *Session) Load(r io.ReadCloser) error {
89
90 b, err := io.ReadAll(r)
91 if err != nil {
92 return err
93 }
94
95 err = r.Close()
96 if err != nil {
97 return err
98 }
99
100 err = json.Unmarshal(b, s)
101 if err != nil {
102 return err
103 }
104
105 return nil
106}

Callers 2

TestSessionFunction · 0.95
loadSessionFunction · 0.95

Calls 1

CloseMethod · 0.80

Tested by 1

TestSessionFunction · 0.76