template

package
v1.0.40 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultPattern = "*.tmpl"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	sync.RWMutex
	fs.FS
	*template.Template
	// contains filtered or unexported fields
}

func NewCache

func NewCache(dir fs.FS) (*Cache, error)

func (*Cache) Exec

func (this *Cache) Exec(w io.Writer, name string, v interface{}) error

func (*Cache) Lookup

func (this *Cache) Lookup(name string) (*template.Template, error)

func (*Cache) String

func (this *Cache) String() string

func (*Cache) Templates

func (this *Cache) Templates() []string

type ContentTypeDetect added in v1.0.37

type ContentTypeDetect struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewContentTypeDetect added in v1.0.37

func NewContentTypeDetect() *ContentTypeDetect

func (*ContentTypeDetect) DetectContentType added in v1.0.37

func (m *ContentTypeDetect) DetectContentType(r io.Reader, info fs.FileInfo) (string, string, error)

DetectContentType returns the detected content type and optionally character set of the given reader, assuming the reader is at the beginning of the file. Will return an empty string if the file has no content, or application/octet-stream if the filetype could not be determined.

Jump to

Keyboard shortcuts

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