Documentation
¶
Overview ¶
Package template is the legacy server HTML-template import path.
New code should import the focused replacement package:
import "github.com/InsideGallery/core/server/view"
Compatibility: existing template exports remain available for downstream consumers that still import server/template. Prefer server/view.NewWithDir or server/view.NewFromOptions so template directory configuration is explicit and call sites avoid a local name collision with html/template.
Index ¶
- Constants
- Variables
- func GetDefaultTemplateDir(prefix string) stringdeprecated
- func SetDefaultTemplateDir(prefix string, d string)deprecated
- type Engine
- type Options
- type Template
- func NewTemplate(name, prefix string, source fs.FS, files ...string) (*Template, error)deprecated
- func NewTemplateBySource(source embed.FS, name, pattern string) (*Template, error)
- func NewTemplateFromOptions(options Options) (*Template, error)
- func NewTemplateWithDir(name, dir string, source fs.FS, files ...string) (*Template, error)
Constants ¶
View Source
const DefaultTemplateDir = "DEFAULT_TEMPLATE_DIR"
DefaultTemplateDir have constant for template
Variables ¶
View Source
var ( ErrExecuteTemplate = errors.New("error execute template") ErrNotFoundTemplate = errors.New("error not found template") )
templates related errors
Functions ¶
func GetDefaultTemplateDir
deprecated
func SetDefaultTemplateDir
deprecated
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine type template engine
type Template ¶
Template describe template
func NewTemplateBySource ¶
NewTemplateBySource return new template bu source
func NewTemplateFromOptions ¶ added in v1.1.0
NewTemplateFromOptions returns a new template from explicit options.
Click to show internal directories.
Click to hide internal directories.