Documentation ¶
Index ¶
- Variables
- func DecodeRpcRequestOrFail(input io.Reader, settings *TemplateSettings, args interface{})
- func EscapeAttr(attr string) string
- func EscapeContent(a interface{}) string
- func IndirectString(a interface{}) string
- func InitGoats(settings *GoatsSettings)
- func IsMergeable(attrName string) bool
- type BaseTemplate
- func (bt *BaseTemplate) FormatString(text string, a ...interface{})
- func (bt *BaseTemplate) GetCallerAttrsFunc() CallerAttrsFunc
- func (bt *BaseTemplate) GetSettings() *TemplateSettings
- func (bt *BaseTemplate) GetWriter() io.Writer
- func (bt *BaseTemplate) SetCallerAttrsFunc(callerAttrsFunc CallerAttrsFunc)
- func (bt *BaseTemplate) WriteString(text string)
- type BuiltinFilter
- func (bf *BuiltinFilter) Capfirst(a interface{}) string
- func (bf *BuiltinFilter) Center(a interface{}, width int) string
- func (bf *BuiltinFilter) Cut(a interface{}, removed string) string
- func (bf *BuiltinFilter) Debug(a interface{}) string
- func (bf *BuiltinFilter) FloatFormat(a interface{}, precision int) string
- func (bf *BuiltinFilter) Format(fmtStr string, a ...interface{}) string
- func (bf *BuiltinFilter) Join(a interface{}, separator string) string
- func (bf *BuiltinFilter) Length(a []interface{}) int
- func (bf *BuiltinFilter) Ljust(a interface{}, width int) string
- func (bf *BuiltinFilter) Quote(a interface{}) string
- func (bf *BuiltinFilter) Rjust(a interface{}, width int) string
- func (bf *BuiltinFilter) Title(a interface{}) string
- func (bf *BuiltinFilter) UnixDate(format string, a interface{}) string
- func (bf *BuiltinFilter) UnixNanoDate(format string, a interface{}) string
- type CallerAttrsFunc
- type GoatsSettings
- type LoopVar
- type ReplaceableFunc
- type TagAttrs
- type Template
- type TemplateSettings
Constants ¶
This section is empty.
Variables ¶
View Source
var MERGEABLE_ATTRS = map[string]bool{ "class": true, "style": true, }
Functions ¶
func DecodeRpcRequestOrFail ¶
func DecodeRpcRequestOrFail(input io.Reader, settings *TemplateSettings, args interface{})
func EscapeAttr ¶
func EscapeContent ¶
func EscapeContent(a interface{}) string
func IndirectString ¶
func IndirectString(a interface{}) string
func InitGoats ¶
func InitGoats(settings *GoatsSettings)
func IsMergeable ¶
Types ¶
type BaseTemplate ¶
type BaseTemplate struct {
// contains filtered or unexported fields
}
func NewBaseTemplate ¶
func NewBaseTemplate(writer io.Writer, settings *TemplateSettings) *BaseTemplate
func (*BaseTemplate) FormatString ¶
func (bt *BaseTemplate) FormatString(text string, a ...interface{})
func (*BaseTemplate) GetCallerAttrsFunc ¶
func (bt *BaseTemplate) GetCallerAttrsFunc() CallerAttrsFunc
func (*BaseTemplate) GetSettings ¶
func (bt *BaseTemplate) GetSettings() *TemplateSettings
func (*BaseTemplate) GetWriter ¶
func (bt *BaseTemplate) GetWriter() io.Writer
func (*BaseTemplate) SetCallerAttrsFunc ¶
func (bt *BaseTemplate) SetCallerAttrsFunc(callerAttrsFunc CallerAttrsFunc)
func (*BaseTemplate) WriteString ¶
func (bt *BaseTemplate) WriteString(text string)
type BuiltinFilter ¶
type BuiltinFilter struct{}
func NewBuiltinFilter ¶
func NewBuiltinFilter() *BuiltinFilter
func (*BuiltinFilter) Capfirst ¶
func (bf *BuiltinFilter) Capfirst(a interface{}) string
func (*BuiltinFilter) Center ¶
func (bf *BuiltinFilter) Center(a interface{}, width int) string
func (*BuiltinFilter) Cut ¶
func (bf *BuiltinFilter) Cut(a interface{}, removed string) string
func (*BuiltinFilter) Debug ¶
func (bf *BuiltinFilter) Debug(a interface{}) string
*
- Prints an arbitrary variable's detailed information to help template authors
- to debug. This is supposed to be used for dev mode only and thus it might have
- a compromised performance.
func (*BuiltinFilter) FloatFormat ¶
func (bf *BuiltinFilter) FloatFormat(a interface{}, precision int) string
func (*BuiltinFilter) Format ¶
func (bf *BuiltinFilter) Format(fmtStr string, a ...interface{}) string
func (*BuiltinFilter) Join ¶
func (bf *BuiltinFilter) Join(a interface{}, separator string) string
func (*BuiltinFilter) Length ¶
func (bf *BuiltinFilter) Length(a []interface{}) int
func (*BuiltinFilter) Ljust ¶
func (bf *BuiltinFilter) Ljust(a interface{}, width int) string
func (*BuiltinFilter) Quote ¶
func (bf *BuiltinFilter) Quote(a interface{}) string
func (*BuiltinFilter) Rjust ¶
func (bf *BuiltinFilter) Rjust(a interface{}, width int) string
func (*BuiltinFilter) Title ¶
func (bf *BuiltinFilter) Title(a interface{}) string
func (*BuiltinFilter) UnixDate ¶
func (bf *BuiltinFilter) UnixDate(format string, a interface{}) string
Example:
<div go:content="unixdate('01/02/2006 15:04:05'), 1390637053836182000"></div>
func (*BuiltinFilter) UnixNanoDate ¶
func (bf *BuiltinFilter) UnixNanoDate(format string, a interface{}) string
Example:
<div go:content="unixnanodate('01/02/2006 15:04:05'), 1390637053836182000"></div>
type CallerAttrsFunc ¶
type GoatsSettings ¶
type GoatsSettings struct { DevServerPort int // Only used for dev mode PkgRoot string // Only used for dev mode TemplateDir string // Only used for dev mode OutputDir string // Only used for dev mode }
func NewGoatsSettings ¶
func NewGoatsSettings() *GoatsSettings
type ReplaceableFunc ¶
type ReplaceableFunc func()
type TagAttrs ¶
func (TagAttrs) GenTagAndAttrs ¶
type Template ¶
type Template interface { GetCallerAttrsFunc() CallerAttrsFunc SetCallerAttrsFunc(CallerAttrsFunc) }
type TemplateSettings ¶
Click to show internal directories.
Click to hide internal directories.