multi

package
v2.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2017 License: Apache-2.0 Imports: 3 Imported by: 37 modules, 32 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Multi

type Multi struct {
	// contains filtered or unexported fields
}

Multi implements jet.Loader interface and tries to load templates from a list of custom loaders.

func NewLoader

func NewLoader(loaders ...jet.Loader) *Multi

NewLoader returns a new multi loader. The order of the loaders passed as parameters will define the order in which templates are loaded.

func (*Multi) AddLoaders

func (m *Multi) AddLoaders(loaders ...jet.Loader)

AddLoaders adds the passed loaders to the list of loaders.

func (*Multi) ClearLoaders

func (m *Multi) ClearLoaders()

ClearLoaders clears the list of loaders.

func (*Multi) Exists

func (m *Multi) Exists(name string) (string, bool)

Exists checks all loaders in succession, returning the full path of the template and bool true if the template file was found, otherwise it returns an empty string and false.

func (*Multi) Open

func (m *Multi) Open(name string) (io.ReadCloser, error)

Open will open the file passed by trying all loaders in succession.

Jump to

Keyboard shortcuts

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