tpongo2: gitea.com/tango/tpongo2 Index | Files

package tpongo2

import "gitea.com/tango/tpongo2"

Index

Package Files

tpongo2.go

Constants

const (
    ContentType           = "Content-Type"
    ContentLength         = "Content-Length"
    ContentBinary         = "application/octet-stream"
    ContentJSON           = "application/json"
    ContentHTML           = "text/html"
    ContentXHTML          = "application/xhtml+xml"
    ContentXML            = "text/xml"
    DefaultCharset        = "UTF-8"
    DefaultTemplateSuffix = ".html"
)

type Options Uses

type Options struct {
    TemplatesDir string
    Reload       bool
    Suffix       string
}

type Pongo Uses

type Pongo struct {
    Options
    // contains filtered or unexported fields
}

func Default Uses

func Default() *Pongo

func New Uses

func New(opts ...Options) *Pongo

func (*Pongo) GetTemplate Uses

func (p *Pongo) GetTemplate(name string) (t *pongo2.Template, err error)

func (*Pongo) Handle Uses

func (p *Pongo) Handle(ctx *tango.Context)

type Pongoer Uses

type Pongoer interface {
    SetRenderer(*Pongo, tango.ResponseWriter, string, string)
}

type Renderer Uses

type Renderer struct {
    tango.ResponseWriter
    ContentType string
    Charset     string
    // contains filtered or unexported fields
}

func (*Renderer) HTMLBytes Uses

func (r *Renderer) HTMLBytes(tmpl string, data map[string]interface{}) ([]byte, error)

func (*Renderer) HTMLString Uses

func (r *Renderer) HTMLString(tmpl string, data map[string]interface{}) (string, error)

func (*Renderer) Render Uses

func (r *Renderer) Render(tmpl string, data map[string]interface{}) error

func (*Renderer) RenderFile Uses

func (r *Renderer) RenderFile(tmpl string, data map[string]interface{}) error

func (*Renderer) RenderString Uses

func (r *Renderer) RenderString(content string, data pongo2.Context) error

TODO: should add cache

func (*Renderer) SetRenderer Uses

func (r *Renderer) SetRenderer(render *Pongo, resp tango.ResponseWriter,
    ContentType, Charset string)

type T Uses

type T map[string]interface{}

Package tpongo2 imports 5 packages (graph). Updated 2020-06-15. Refresh now. Tools for package owners.