template

package
v1.0.47 Latest Latest
Warning

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

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

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