Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
Data contains ContentType and bytes data.
func (Data) Render ¶
func (r Data) Render(w *fasthttp.RequestCtx) (err error)
Render (Data) writes data with custom ContentType.
func (Data) WriteContentType ¶
func (r Data) WriteContentType(w *fasthttp.RequestCtx)
WriteContentType (Data) writes custom ContentType.
type JSON ¶
type JSON struct {
Data any
}
func (JSON) Render ¶
func (r JSON) Render(w *fasthttp.RequestCtx) error
Render (JSON) writes data with custom ContentType.
func (JSON) WriteContentType ¶
func (r JSON) WriteContentType(w *fasthttp.RequestCtx)
WriteContentType (JSON) writes JSON ContentType.
type Reader ¶
type Reader struct { ContentType string ContentLength int Reader io.Reader Headers map[string]string }
Reader contains the IO reader and its length, and custom ContentType and other headers.
func (Reader) Render ¶
func (r Reader) Render(w *fasthttp.RequestCtx) (err error)
Render (Reader) writes data with custom ContentType and headers.
func (Reader) WriteContentType ¶
func (r Reader) WriteContentType(w *fasthttp.RequestCtx)
WriteContentType (Reader) writes custom ContentType.
type Render ¶
type Render interface { // Render writes data with custom ContentType. Render(w *fasthttp.RequestCtx) error // WriteContentType writes custom ContentType. WriteContentType(w *fasthttp.RequestCtx) }
Render interface is to be implemented by JSON, XML, HTML, YAML and so on.
type Text ¶
Text contains the given interface object slice and its format.
func (Text) Render ¶
func (r Text) Render(w *fasthttp.RequestCtx) error
Render (Text) writes data with custom ContentType.
func (Text) WriteContentType ¶
func (r Text) WriteContentType(w *fasthttp.RequestCtx)
WriteContentType (Text) writes Plain ContentType.