xpongo

package module
v0.0.0-...-da93e03 Latest Latest
Warning

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

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

README

	e.HTMLRender = xpongo.New(
		xpongo.WithDebug(gin.IsDebugging()),
		xpongo.WithGlobalContext(map[string]interface{}{
			"settings": configs,
		}),
		xpongo.WithFS(template.FS),
	)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context pongo2.Context

func MapToContext

func MapToContext(m map[string]interface{}) Context

func (Context) String

func (c Context) String() string

type Option

type Option func(opt *config)

func WithDebug

func WithDebug(debug bool) Option

func WithFS

func WithFS(fs fs.FS) Option

func WithGlobalContext

func WithGlobalContext(globalContext map[string]interface{}) Option

func WithPath

func WithPath(path string) Option

type Pongo2

type Pongo2 struct {
	TemplateSet *pongo2.TemplateSet
}

func New

func New(opts ...Option) *Pongo2

func (Pongo2) Instance

func (p Pongo2) Instance(name string, data interface{}) render.Render

type Render

type Render struct {
	Template *pongo2.Template
	Name     string
	Data     interface{}
}

func (Render) Render

func (r Render) Render(w http.ResponseWriter) error

func (Render) WriteContentType

func (r Render) WriteContentType(w http.ResponseWriter)

Jump to

Keyboard shortcuts

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