1
0
Fork 0
forked from goffee/core

add img and class to table template, new responnse buffer inline

This commit is contained in:
Zeni Kim 2025-03-27 12:12:49 -05:00
parent 1a39c666a3
commit db3c510f9a
3 changed files with 17 additions and 4 deletions

View file

@ -40,6 +40,16 @@ func (rs *Response) BufferFile(name string, filetype string, b bytes.Buffer) *Re
return rs
}
// writes the contents of a buffer to the HTTP response with specified file name and type if not terminated.
func (rs *Response) BufferInline(name string, filetype string, b bytes.Buffer) *Response {
if rs.isTerminated == false {
rs.HttpResponseWriter.Header().Add("Content-Type", filetype)
b.WriteTo(rs.HttpResponseWriter)
}
return rs
}
// sets the response's content type to HTML and assigns the provided body as the response body if not terminated.
func (rs *Response) Any(body any) *Response {
if rs.isTerminated == false {