Documentation ¶
Index ¶
- func NewPlaceholder(name string, escaper ...func(interface{}) string) placeholder.Placeholder
- type Buffer
- type Escaper
- type Template
- func (t *Template) Add(data ...interface{}) (err error)
- func (t *Template) Handle(phs ...placeholder.PlaceholderHandler) http.Handler
- func (t *Template) MustAdd(data ...interface{}) *Template
- func (t *Template) MustWrite(b []byte)
- func (t *Template) MustWriteByte(b byte)
- func (t *Template) MustWriteRune(r rune)
- func (t *Template) MustWriteSetter(s placeholder.Setter)
- func (t *Template) MustWriteString(s string)
- func (t *Template) MustWriteTo(w io.Writer)
- func (t *Template) New() *Buffer
- func (t *Template) Parse() *Template
- func (r *Template) Replace(setters ...placeholder.Setter) (bf *Buffer)
- func (r *Template) ReplaceMixed(mixed ...interface{}) (bf *Buffer)
- func (r *Template) ReplaceMixedTo(b *bytes.Buffer, mixed ...interface{}) (bf *Buffer)
- func (r *Template) ReplaceTo(b *bytes.Buffer, setters ...placeholder.Setter) (bf *Buffer)
- func (t *Template) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (t *Template) String() string
- func (t *Template) WriteSetter(p placeholder.Setter) (err error)
- type TemplatePlaceholder
- func (p TemplatePlaceholder) Name() string
- func (p TemplatePlaceholder) Set(val interface{}) placeholder.Setter
- func (p TemplatePlaceholder) SetString() string
- func (p TemplatePlaceholder) Setf(format string, vals ...interface{}) placeholder.Setter
- func (p TemplatePlaceholder) WriteTo(w io.Writer) (int64, error)
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPlaceholder ¶
func NewPlaceholder(name string, escaper ...func(interface{}) string) placeholder.Placeholder
Types ¶
type Buffer ¶
a named buffer, fullfills the Setter interface
type Template ¶
type Template struct { *Buffer // contains filtered or unexported fields }
func (*Template) Handle ¶
func (t *Template) Handle(phs ...placeholder.PlaceholderHandler) http.Handler
TODO check how it could work for subtemplates and multi replacements and how it could integrate with context and router and integrate it with html lib
func (*Template) MustWriteByte ¶
func (*Template) MustWriteRune ¶
func (*Template) MustWriteSetter ¶
func (t *Template) MustWriteSetter(s placeholder.Setter)
func (*Template) MustWriteString ¶
func (*Template) MustWriteTo ¶
func (*Template) ReplaceMixed ¶
func (*Template) ReplaceMixedTo ¶
func (*Template) WriteSetter ¶
func (t *Template) WriteSetter(p placeholder.Setter) (err error)
type TemplatePlaceholder ¶
type TemplatePlaceholder struct { Value string Escaper []func(interface{}) string // contains filtered or unexported fields }
func (TemplatePlaceholder) Name ¶
func (p TemplatePlaceholder) Name() string
func (TemplatePlaceholder) Set ¶
func (p TemplatePlaceholder) Set(val interface{}) placeholder.Setter
func (TemplatePlaceholder) SetString ¶
func (p TemplatePlaceholder) SetString() string
func (TemplatePlaceholder) Setf ¶
func (p TemplatePlaceholder) Setf(format string, vals ...interface{}) placeholder.Setter
type View ¶
type View struct {
// contains filtered or unexported fields
}
func (*View) HasPlaceholder ¶
func (*View) Placeholder ¶
func (str *View) Placeholder(field string) placeholder.Placeholder
func (*View) Set ¶
func (str *View) Set(stru interface{}) (ss []placeholder.Setter)
Click to show internal directories.
Click to hide internal directories.