如何使用gin框架将数据作为文件响应?

I meet a case which is: receive a download request => pull data from some source => response data as a file(e.g. xxx.log) to user.

I know that in gin, you may use gin.Context.File(path) to serve a file, but the file has to be a static local file, write data to host and serve it then delete it looks stupid, is there any way to finish all these things in memory?