template

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: MIT Imports: 10 Imported by: 0

README

template

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChineseDate

func ChineseDate(t time.Time) string

func Javascript added in v0.0.6

func Javascript(data interface{}) template.JS

func RMB

func RMB(v float64) string

Types

type Option

type Option func(*Template)

func Delims

func Delims(left string, right string) Option

func Dir

func Dir(dir string) Option

func Extension

func Extension(ext string) Option

func Function

func Function(name string, fn interface{}) Option

func Name

func Name(name string) Option

func NameByPath

func NameByPath(flag bool) Option

type Template

type Template struct {
	*template.Template
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Template

func (*Template) AddFunc

func (t *Template) AddFunc(name string, fn interface{})

func (*Template) Find

func (t *Template) Find(uri string) (string, error)

func (*Template) Open

func (t *Template) Open() error

Jump to

Keyboard shortcuts

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