renderer

package
v0.0.0-...-1ba6274 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyFunction  = errors.New("function is empty")
	ErrMissingTitle   = errors.New("missing function name")
	ErrFunctionExists = errors.New("function with title already exists")
	ErrEmptyFS        = errors.New("provided fs.FS is nil")
	ErrMissingFiles   = errors.New("missing names of files to use")
)

Functions

func New

func New(files fs.FS, opts ...Option) (echo.Renderer, error)

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

func AddFiles

func AddFiles(files ...string) Option

AddFiles to be used with the renderer. This function removes duplicates.

func Func

func Func(title string, function any) Option

Func adds a function to use in the templates. Title must be unique.

func Name

func Name(name string) Option

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

func (*Renderer) Render

func (r *Renderer) Render(w io.Writer, name string, data any, c echo.Context) error

Jump to

Keyboard shortcuts

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