Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AsciiJSON ¶
type AsciiJSON struct {
Data any
}
AsciiJSON contains the given interface object.
func (AsciiJSON) Render ¶
func (r AsciiJSON) Render(w http.ResponseWriter) (err error)
Render (AsciiJSON) marshals the given interface object and writes it with custom ContentType.
func (AsciiJSON) WriteContentType ¶
func (r AsciiJSON) WriteContentType(w http.ResponseWriter)
WriteContentType (AsciiJSON) writes JSON ContentType.
type Data ¶
Data contains ContentType and bytes data.
func (Data) Render ¶
func (r Data) Render(w http.ResponseWriter) (err error)
Render (Data) writes data with custom ContentType.
func (Data) WriteContentType ¶
func (r Data) WriteContentType(w http.ResponseWriter)
WriteContentType (Data) writes custom ContentType.
type Delims ¶
type Delims struct {
// Left delimiter, defaults to {{.
Left string
// Right delimiter, defaults to }}.
Right string
}
Delims represents a set of Left and Right delimiters for HTML template rendering.
type HTML ¶
HTML contains template reference and its name with given interface object.
func (HTML) Render ¶
func (r HTML) Render(w http.ResponseWriter) error
Render (HTML) executes template and writes its result with custom ContentType for response.
func (HTML) WriteContentType ¶
func (r HTML) WriteContentType(w http.ResponseWriter)
WriteContentType (HTML) writes HTML ContentType.
type HTMLProduction ¶
HTMLProduction contains template reference and its delims.
func (HTMLProduction) Instance ¶
func (r HTMLProduction) Instance(name string, data any) Render
Instance (HTMLProduction) returns an HTML instance which it realizes Render interface.
type HTMLRender ¶
HTMLRender interface is to be implemented by HTMLProduction and HTMLDebug.
type IndentedJSON ¶
type IndentedJSON struct {
Data any
}
IndentedJSON contains the given interface object.
func (IndentedJSON) Render ¶
func (r IndentedJSON) Render(w http.ResponseWriter) error
Render (IndentedJSON) marshals the given interface object and writes it with custom ContentType.
func (IndentedJSON) WriteContentType ¶
func (r IndentedJSON) WriteContentType(w http.ResponseWriter)
WriteContentType (IndentedJSON) writes JSON ContentType.
type JSON ¶
type JSON struct {
Data any
}
JSON contains the given interface object.
func (JSON) Render ¶
func (r JSON) Render(w http.ResponseWriter) error
Render (JSON) writes data with custom ContentType.
func (JSON) WriteContentType ¶
func (r JSON) WriteContentType(w http.ResponseWriter)
WriteContentType (JSON) writes JSON ContentType.
type JsonpJSON ¶
JsonpJSON contains the given interface object its callback.
func (JsonpJSON) Render ¶
func (r JsonpJSON) Render(w http.ResponseWriter) (err error)
Render (JsonpJSON) marshals the given interface object and writes it and its callback with custom ContentType.
func (JsonpJSON) WriteContentType ¶
func (r JsonpJSON) WriteContentType(w http.ResponseWriter)
WriteContentType (JsonpJSON) writes Javascript ContentType.
type PureJSON ¶
type PureJSON struct {
Data any
}
PureJSON contains the given interface object.
func (PureJSON) Render ¶
func (r PureJSON) Render(w http.ResponseWriter) error
Render (PureJSON) writes custom ContentType and encodes the given interface object.
func (PureJSON) WriteContentType ¶
func (r PureJSON) WriteContentType(w http.ResponseWriter)
WriteContentType (PureJSON) writes custom ContentType.
type SecureJSON ¶
SecureJSON contains the given interface object and its prefix.
func (SecureJSON) Render ¶
func (r SecureJSON) Render(w http.ResponseWriter) error
Render (SecureJSON) marshals the given interface object and writes it with custom ContentType.
func (SecureJSON) WriteContentType ¶
func (r SecureJSON) WriteContentType(w http.ResponseWriter)
WriteContentType (SecureJSON) writes JSON ContentType.