add img and class to table template, new responnse buffer inline
This commit is contained in:
parent
1a39c666a3
commit
db3c510f9a
3 changed files with 17 additions and 4 deletions
10
response.go
10
response.go
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue