MCPcopy
hub / github.com/keploy/keploy / encodePayload

Function encodePayload

pkg/agent/proxy/integrations/generic/encode.go:248–264  ·  view source on GitHub ↗
(buf []byte, origin models.OriginType)

Source from the content-addressed store, hash-verified

246}
247
248func encodePayload(buf []byte, origin models.OriginType) models.Payload {
249 bufStr := string(buf)
250 dataType := models.String
251 if !util.IsASCII(string(buf)) {
252 bufStr = util.EncodeBase64(buf)
253 dataType = "binary"
254 }
255 return models.Payload{
256 Origin: origin,
257 Message: []models.OutputBinary{
258 {
259 Type: dataType,
260 Data: bufStr,
261 },
262 },
263 }
264}

Callers 2

createGenericMocksAsyncFunction · 0.85
encodeGenericV2Function · 0.85

Calls 2

IsASCIIFunction · 0.92
EncodeBase64Function · 0.92

Tested by

no test coverage detected