view

package
v0.0.0-...-7690095 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2017 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMinGZIPSize = 1000

Variables

This section is empty.

Functions

func GetContentType

func GetContentType(ext string) (contentType string)

func GetMinGZIPSize

func GetMinGZIPSize() int

func SetMinGZIPSize

func SetMinGZIPSize(i int)

Types

type FileDownloadView

type FileDownloadView struct {
	FilePath string
	CType    string
	FileName string
}

func NewFileDownloadView

func NewFileDownloadView(fpath string, fname string, ctype string) *FileDownloadView

func (*FileDownloadView) ContentType

func (fv *FileDownloadView) ContentType(ctxt *web.Context) string

func (*FileDownloadView) Publish

func (fv *FileDownloadView) Publish(ctxt *web.Context) (err error)

func (*FileDownloadView) Render

func (fv *FileDownloadView) Render(ctxt *web.Context) ([]byte, error)

func (*FileDownloadView) RenderString

func (fv *FileDownloadView) RenderString(ctxt *web.Context) (string, error)

type FullJSONView

type FullJSONView JSONView

func NewFullJSONView

func NewFullJSONView(vmap mvc.VM) FullJSONView

func (FullJSONView) ContentType

func (jv FullJSONView) ContentType(ctxt *web.Context) string

func (FullJSONView) Publish

func (jv FullJSONView) Publish(ctxt *web.Context) error

func (FullJSONView) Render

func (jv FullJSONView) Render(ctxt *web.Context) ([]byte, error)

func (FullJSONView) RenderString

func (jv FullJSONView) RenderString(ctxt *web.Context) (string, error)

func (*FullJSONView) SetData

func (jv *FullJSONView) SetData(name string, value interface{})

func (*FullJSONView) SetVMap

func (jv *FullJSONView) SetVMap(vmap ...mvc.VM)

type HTMLView

type HTMLView struct {
	mvc.VM
	GetTmpl func(fmap template.FuncMap) (t *template.Template, err error)
	// contains filtered or unexported fields
}

func (*HTMLView) ContentType

func (hv *HTMLView) ContentType(ctxt *web.Context) string

func (*HTMLView) Publish

func (hv *HTMLView) Publish(ctxt *web.Context) (err error)

func (*HTMLView) Render

func (hv *HTMLView) Render(ctxt *web.Context) (b []byte, err error)

func (*HTMLView) RenderString

func (hv *HTMLView) RenderString(ctxt *web.Context) (s string, err error)

func (*HTMLView) SetData

func (hv *HTMLView) SetData(name string, value interface{})

func (*HTMLView) SetGetTmpl

func (hv *HTMLView) SetGetTmpl(f func(fmap template.FuncMap) (t *template.Template, err error))

func (*HTMLView) SetVMap

func (hv *HTMLView) SetVMap(vmap ...mvc.VM)

func (*HTMLView) SetViewFunc

func (hv *HTMLView) SetViewFunc(name string, f interface{})

func (*HTMLView) SetViewFuncName

func (hv *HTMLView) SetViewFuncName(name string)

type JSONView

type JSONView mvc.VM

func NewJSONView

func NewJSONView(vmap mvc.VM) JSONView

func (JSONView) ContentType

func (jv JSONView) ContentType(ctxt *web.Context) string

func (JSONView) Publish

func (jv JSONView) Publish(ctxt *web.Context) error

func (JSONView) Render

func (jv JSONView) Render(ctxt *web.Context) ([]byte, error)

func (JSONView) RenderString

func (jv JSONView) RenderString(ctxt *web.Context) (string, error)

type MultiView

type MultiView struct {
	mvc.VM
	GetTmpl func(fmap template.FuncMap) (t *template.Template, err error)
	// contains filtered or unexported fields
}

func (*MultiView) ContentType

func (mv *MultiView) ContentType(ctxt *web.Context) string

func (*MultiView) Publish

func (mv *MultiView) Publish(ctxt *web.Context) (err error)

func (*MultiView) Render

func (mv *MultiView) Render(ctxt *web.Context) (b []byte, err error)

func (*MultiView) RenderString

func (mv *MultiView) RenderString(ctxt *web.Context) (s string, err error)

func (*MultiView) SetData

func (mv *MultiView) SetData(name string, value interface{})

func (*MultiView) SetGetTmpl

func (mv *MultiView) SetGetTmpl(f func(fmap template.FuncMap) (t *template.Template, err error))

func (*MultiView) SetVMap

func (mv *MultiView) SetVMap(vmap ...mvc.VM)

func (*MultiView) SetViewFunc

func (mv *MultiView) SetViewFunc(name string, f interface{})

func (*MultiView) SetViewFuncName

func (mv *MultiView) SetViewFuncName(name string)

type ResultView

type ResultView struct {
	mvc.VM
	GetTmpl func(fmap template.FuncMap) (t *template.Template, err error)
	// contains filtered or unexported fields
}

func NewResultView

func NewResultView(vmap mvc.VM) *ResultView

func (*ResultView) ContentType

func (rv *ResultView) ContentType(ctxt *web.Context) string

func (*ResultView) Publish

func (rv *ResultView) Publish(ctxt *web.Context) (err error)

func (*ResultView) Render

func (rv *ResultView) Render(ctxt *web.Context) (b []byte, err error)

func (*ResultView) RenderString

func (rv *ResultView) RenderString(ctxt *web.Context) (s string, err error)

func (*ResultView) SetData

func (rv *ResultView) SetData(name string, value interface{})

func (*ResultView) SetGetTmpl

func (rv *ResultView) SetGetTmpl(f func(fmap template.FuncMap) (t *template.Template, err error))

func (*ResultView) SetVMap

func (rv *ResultView) SetVMap(vmap ...mvc.VM)

func (*ResultView) SetViewFunc

func (rv *ResultView) SetViewFunc(name string, f interface{})

func (*ResultView) SetViewFuncName

func (rv *ResultView) SetViewFuncName(name string)

Jump to

Keyboard shortcuts

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