Loader is a minimal interface required for loading templates. Jet will build an absolute path (with slash delimiters) before looking up templates by resolving paths in extends/import/include statements: - `{{ extends "/bar.jet" }}` will make Jet look up `/bar.jet` in the Loader unchanged, no matte
| 42 | // `/bar.html.jet` and `/bar.jet.html` (in that order). To avoid unneccessary lookups, use the full file name in your templates (so the first lookup |
| 43 | // is always a hit, or override this list of extensions using Set.SetExtensions(). |
| 44 | type Loader interface { |
| 45 | // Exists returns whether or not a template exists under the requested path. |
| 46 | Exists(templatePath string) bool |
| 47 | |
| 48 | // Open returns the template's contents or an error if something went wrong. |
| 49 | // Calls to Open() will always be preceded by a call to Exists() with the same `templatePath`. |
| 50 | // It is the caller's duty to close the template. |
| 51 | Open(templatePath string) (io.ReadCloser, error) |
| 52 | } |
| 53 | |
| 54 | // OSFileSystemLoader implements Loader interface using OS file system (os.File). |
| 55 | type OSFileSystemLoader struct { |
no outgoing calls
no test coverage detected
searching dependent graphs…