binding

package
v0.2.33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIMEJSON     = "application/json"
	MIMEJSONUTF8 = "application/json;charset=utf-8"
	MIMEXML      = "application/xml"
	MIMEXML2     = "text/xml"
	MIMEYAML     = "application/x-yaml"
	MIMETEXT     = "text/html"
)

Variables

View Source
var (
	JSON      = jsonBinding{}
	GZIPJSON  = gzipJsonBinding{}
	XML       = xmlBinding{}
	YAML      = yamlBinding{}
	JSONP     = jsonpBinding{}
	GZIPJSONP = gzipJsonpBinding{}
	TEXT      = textBinding{}
)

Functions

This section is empty.

Types

type Binding

type Binding interface {
	Name() string
	Bind(*http.Request, []byte, interface{}) error
}

Binding

func NewBind

func NewBind(contentType string) Binding

type HTML

type HTML struct {
	Template *template.Template
	Name     string
}

HTML

func (HTML) Render

func (h HTML) Render(code int, w http.ResponseWriter, value interface{}) error

Render

type Rendering

type Rendering interface {
	Render(int, http.ResponseWriter, interface{}) error
}

Render

func NewHTML

func NewHTML(name string, template *template.Template) Rendering

NewHTML

func NewRender

func NewRender(contentType string) Rendering

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL