MCPcopy
hub / github.com/53AI/53AIHub / ToResponse

Method ToResponse

api/model/response.go:112–121  ·  view source on GitHub ↗
(data interface{})

Source from the content-addressed store, hash-verified

110}
111
112func (c ResponseCode) ToResponse(data interface{}) CommonResponse {
113 if err, ok := data.(error); ok {
114 return c.ToErrorResponse(err)
115 }
116 return CommonResponse{
117 Code: int(c),
118 Message: c.Message(),
119 Data: data,
120 }
121}
122
123func (c ResponseCode) ToErrorResponse(err error) CommonResponse {
124 return CommonResponse{

Callers 15

WorkflowRunFunction · 0.95
BatchUploadAuthFunction · 0.80
UserTokenAuthFunction · 0.80
updateBodyFunction · 0.80
MustParseIDParamFunction · 0.80
FileLogViewerAuthFunction · 0.80
TestChannelFunction · 0.80
returnResponseFunction · 0.80
CreateSpaceFunction · 0.80
GetSpacesFunction · 0.80
GetSpaceFunction · 0.80

Calls 3

ToErrorResponseMethod · 0.95
MessageMethod · 0.95
intFunction · 0.85

Tested by 2

TestChannelFunction · 0.64
TestBochaAISearchFunction · 0.64