MCPcopy Index your code
hub / github.com/1Panel-dev/KubePi / OpenFile

Method OpenFile

internal/api/v1/file/file.go:112–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110}
111
112func (h *Handler) OpenFile() iris.Handler {
113 return func(ctx *context.Context) {
114 var req fileModel.Request
115 if err := ctx.ReadJSON(&req); err != nil {
116 ctx.StatusCode(iris.StatusBadRequest)
117 ctx.Values().Set("message", err.Error())
118 return
119 }
120 withRequestUser(ctx, &req)
121 res, err := h.fileService.CatFile(req)
122 if err != nil {
123 ctx.StatusCode(iris.StatusInternalServerError)
124 ctx.Values().Set("message", err.Error())
125 return
126 }
127 ctx.Values().Set("data", string(res))
128 }
129}
130
131func (h *Handler) ReNameFile() iris.Handler {
132 return func(ctx *context.Context) {

Callers 4

InstallFunction · 0.95
CopyFileFromPodMethod · 0.80
CopyFolderFromPodMethod · 0.80
setUpTtyEntrypointMethod · 0.80

Calls 4

withRequestUserFunction · 0.85
ErrorMethod · 0.80
CatFileMethod · 0.65
SetMethod · 0.45

Tested by

no test coverage detected