binding

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	JSON  = jsonBinding{}
	XML   = xmlBinding{}
	YAML  = yamlBinding{}
	JSONP = jsonpBinding{}
	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