MCPcopy
hub / github.com/gin-gonic/gin / File

Method File

context.go:1280–1282  ·  view source on GitHub ↗

File writes the specified file into the body stream in an efficient way.

(filepath string)

Source from the content-addressed store, hash-verified

1278
1279// File writes the specified file into the body stream in an efficient way.
1280func (c *Context) File(filepath string) {
1281 http.ServeFile(c.Writer, c.Request, filepath)
1282}
1283
1284// FileFromFS writes the specified file from http.FileSystem into the body stream in an efficient way.
1285func (c *Context) FileFromFS(filepath string, fs http.FileSystem) {

Callers 7

TestContextFileFunction · 0.80
TestContextRenderFileFunction · 0.80
TestFileDescriptorFunction · 0.80
TestContextFileSimpleFunction · 0.80
TestContextFileNotFoundFunction · 0.80
StaticFileMethod · 0.80
OpenMethod · 0.80

Calls

no outgoing calls

Tested by 5

TestContextFileFunction · 0.64
TestContextRenderFileFunction · 0.64
TestFileDescriptorFunction · 0.64
TestContextFileSimpleFunction · 0.64
TestContextFileNotFoundFunction · 0.64