loader

package module
v0.0.0-...-b069fe2 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2018 License: MIT Imports: 7 Imported by: 0

README

pongo2-fileb0x

GoDoc MIT License

This (relatively simple) package provides a pongo2 loader for templates embedded in an executable with fileb0x.

Usage

Begin by importing the package:

import "github.com/nathan-osman/pongo2-fileb0x"

Create a loader (FS and CTX are provided by ab0x.go, which is generated by fileb0x):

l := &loader.Fileb0xLoader{
    FS:  FS,
    CTX: CTX,
}

Now create a new template set using the loader:

t := pongo2.NewSet("", l)

That's it!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fileb0xLoader

type Fileb0xLoader struct {
	FS  webdav.FileSystem
	CTX context.Context
}

Fileb0xLoader provides a Pongo2 loader for fileb0x template files.

func (*Fileb0xLoader) Abs

func (f *Fileb0xLoader) Abs(base, name string) string

Abs returns the absolute path to a template file.

func (*Fileb0xLoader) Get

func (f *Fileb0xLoader) Get(path string) (io.Reader, error)

Get retrieves a reader for the specified path.

Jump to

Keyboard shortcuts

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