jetpackr

package module
Version: v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: MIT Imports: 3 Imported by: 5

README

Jet Template Engine Packr Loader

Build Status Coverage Status Go.Dev reference Go Report Card Release Downloads

Install

$ go get -u clevergo.tech/jetpackr

Usage

See example.

package main

import (
	"github.com/CloudyKit/jet/v5"
	"github.com/clevergo/jetpackr"
	"github.com/gobuffalo/packr/v2"
)

func main() {
	box := packr.New("views", "./views")
	view := jet.NewHTMLSetLoader(jetpackr.New(box))
	// ...
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loader

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

Loader a file system loader.

func New

func New(box *packr.Box) *Loader

New returns a loader associate with the given packr box.

func (*Loader) Exists

func (l *Loader) Exists(name string) (string, bool)

Exists implements interface loader's exists function.

func (*Loader) Open

func (l *Loader) Open(name string) (io.ReadCloser, error)

Open implements interface loader's open function.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL