bindata

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2016 License: MPL-2.0 Imports: 10 Imported by: 270

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	// Asset, AssetDir are functions used to look up the assets.
	// These match the function signatures used by go-bindata so you
	// can just use method handles for these.
	Asset    func(string) ([]byte, error)
	AssetDir func(string) ([]string, error)

	// Context is the template context that is given when rendering
	Context map[string]interface{}

	// SharedExtends is a mapping of share prefixes and files that can be
	// accessed using {% extends %} in templates. Example:
	// {% extends "foo:bar/baz.tpl" %} would find the "bar/baz.tpl" in the
	// "foo" share.
	SharedExtends map[string]*Data
}

Data is the struct that wraps the assets go-bindata generates in your package to provide more helpers.

func (*Data) CopyDir

func (d *Data) CopyDir(dst, prefix string) error

CopyDir copies all the assets from the given prefix to the destination directory. It will automatically set file permissions, create folders, etc.

func (*Data) RenderAsset

func (d *Data) RenderAsset(dst, src string) error

RenderAsset renders a single bindata asset. This file will be processed as a template if it ends in ".tpl".

func (*Data) RenderReal

func (d *Data) RenderReal(dst, src string) error

RenderReal renders a real file (not a bindata'd file). This file will be processed as a template if it ends in ".tpl".

func (*Data) RenderString

func (d *Data) RenderString(tpl string) (string, error)

RenderString renders a string.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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