MCPcopy
hub / github.com/andeya/pholcus / Serialize

Method Serialize

app/downloader/request/request.go:126–136  ·  view source on GitHub ↗

Serialize serializes the Request to JSON string.

()

Source from the content-addressed store, hash-verified

124
125// Serialize serializes the Request to JSON string.
126func (r *Request) Serialize() result.Result[string] {
127 for k, v := range r.Temp {
128 r.Temp.set(k, v)
129 r.TempIsJSON[k] = true
130 }
131 b, err := json.Marshal(r)
132 if err != nil {
133 return result.TryErr[string](err)
134 }
135 return result.Ok(strings.ReplaceAll(util.Bytes2String(b), `\u0026`, `&`))
136}
137
138// Unique returns the unique identifier for the request.
139func (r *Request) Unique() string {

Callers 6

TestSerializeUnSerializeFunction · 0.95
TestGetTempOptFunction · 0.95
flushMethod · 0.80

Calls 3

Bytes2StringFunction · 0.92
MarshalMethod · 0.65
setMethod · 0.45