Documentation ¶
Overview ¶
Package templates provides a store for templates which supports caching
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TemplateCacheExecutor ¶ added in v0.3.0
type TemplateCacheExecutor struct {
// contains filtered or unexported fields
}
TemplateCacheExecutor caches templates after reading them from the disk
func NewTemplateCacheExecutor ¶ added in v0.3.0
func NewTemplateCacheExecutor(log logrus.FieldLogger) *TemplateCacheExecutor
func (*TemplateCacheExecutor) Get ¶ added in v0.3.0
func (ex *TemplateCacheExecutor) Get(ctx context.Context, template Template) *htmlTemplate.Template
type TemplateDiskExecutor ¶ added in v0.3.0
type TemplateDiskExecutor struct {
// contains filtered or unexported fields
}
TemplateDiskExecutor reads templates from disk every execution
func NewTemplateDiskExecutor ¶ added in v0.3.0
func NewTemplateDiskExecutor(log logrus.FieldLogger) *TemplateDiskExecutor
func (*TemplateDiskExecutor) Get ¶ added in v0.3.0
func (ex *TemplateDiskExecutor) Get(ctx context.Context, template Template) *htmlTemplate.Template
type TemplateExecutor ¶ added in v0.3.0
type TemplateExecutor interface { // Get returns template with passed path. It should panic if template doesn't exist Get(ctx context.Context, t Template) *htmlTemplate.Template // Execute executes template. It should panic if template doesn't exist Execute(ctx context.Context, t Template, w io.Writer, data interface{}) error }
Click to show internal directories.
Click to hide internal directories.