mandira: github.com/jmoiron/mandira Index | Files | Directories

package mandira

import "github.com/jmoiron/mandira"

Index

Package Files

eval.go filters.go loader.go mandira.go parser.go

func AddFilter Uses

func AddFilter(filter interface{}, name ...string)

func BoolEval Uses

func BoolEval(oper string, lhs, rhs interface{}, contexts []interface{}) bool

func CompEval Uses

func CompEval(oper string, lhs, rhs interface{}, contexts []interface{}) bool

func Date Uses

func Date(arg interface{}, format string) interface{}

func DivisibleBy Uses

func DivisibleBy(base_, by_ interface{}) bool

func Eval Uses

func Eval(expr interface{}, contexts []interface{}) (interface{}, error)

run eval for something which is a cond or a conditional

func Format Uses

func Format(arg interface{}, format string) interface{}

func GetFilter Uses

func GetFilter(name string) interface{}

Return a filter (or nil)

func Index Uses

func Index(arg interface{}, idx_ interface{}) interface{}

Return the index of the argument at arg I

func IsTemplate Uses

func IsTemplate(path string) bool

func Join Uses

func Join(arg interface{}, joiner string) string

func Len Uses

func Len(arg interface{}) int

Return the length of the argument, or 0 if that is not a valid action

func Render Uses

func Render(data string, context ...interface{}) string

func RenderFile Uses

func RenderFile(filename string, context ...interface{}) string

func RenderFileInLayout Uses

func RenderFileInLayout(filename string, layoutFile string, context ...interface{}) string

func RenderInLayout Uses

func RenderInLayout(data string, layoutData string, context ...interface{}) string

type Loader Uses

type Loader struct {
    Path    string
    Preload bool
    Loaded  bool
    // contains filtered or unexported fields
}

func NewLoader Uses

func NewLoader(path string, preload bool) *Loader

func (*Loader) Add Uses

func (l *Loader) Add(path string, template *Template)

If you want to add a template sourced from elsewhere to the loader, you can do it here and continue to use the loader.

func (*Loader) Cache Uses

func (l *Loader) Cache() map[string]*Template

Return the internal cache

func (*Loader) Get Uses

func (l *Loader) Get(path string) (*Template, error)

func (*Loader) MustGet Uses

func (l *Loader) MustGet(path string) *Template

func (*Loader) Refresh Uses

func (l *Loader) Refresh() error

type Template Uses

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

func ParseFile Uses

func ParseFile(filename string) (*Template, error)

func ParseString Uses

func ParseString(data string) (*Template, error)

func (*Template) Render Uses

func (tmpl *Template) Render(context ...interface{}) string

func (*Template) RenderInLayout Uses

func (tmpl *Template) RenderInLayout(layout *Template, context ...interface{}) string

Directories

PathSynopsis
mandira

Package mandira imports 13 packages (graph) and is imported by 9 packages. Updated 2016-07-19. Refresh now. Tools for package owners.