MCPcopy Create free account
hub / github.com/DoNewsCode/core / NewResponseEncoder

Function NewResponseEncoder

srvhttp/encode.go:37–39  ·  view source on GitHub ↗

NewResponseEncoder wraps the http.ResponseWriter and returns a reference to ResponseEncoder

(w http.ResponseWriter)

Source from the content-addressed store, hash-verified

35
36// NewResponseEncoder wraps the http.ResponseWriter and returns a reference to ResponseEncoder
37func NewResponseEncoder(w http.ResponseWriter) *ResponseEncoder {
38 return &ResponseEncoder{w: w}
39}
40
41// Encode serialize response and error to the corresponding json format and write then to the output buffer.
42//

Callers 3

TestEncoderFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestEncoderFunction · 0.68