templates

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: MIT Imports: 10 Imported by: 0

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 Template added in v0.3.0

type Template struct {
	Path string
	Deps []string
}

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) Execute added in v0.3.0

func (ex *TemplateCacheExecutor) Execute(ctx context.Context, template Template, w io.Writer, data interface{}) error

func (*TemplateCacheExecutor) Get added in v0.3.0

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) Execute added in v0.3.0

func (ex *TemplateDiskExecutor) Execute(ctx context.Context, template Template, w io.Writer, data interface{}) error

func (*TemplateDiskExecutor) Get added in v0.3.0

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
}

Jump to

Keyboard shortcuts

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