Documentation ¶
Index ¶
- type GoLayout
- func (l *GoLayout) LoadLayoutFile(fileName string) error
- func (l *GoLayout) LoadLayoutString(contents []byte) error
- func (l *GoLayout) RenderViewFile(fileName string, context interface{}) (string, error)
- func (l *GoLayout) RenderViewFilef(writer http.ResponseWriter, fileName string, context interface{}) error
- func (l *GoLayout) RenderViewString(contents []byte, context interface{}) (string, error)
- func (l *GoLayout) RenderViewStringf(writer http.ResponseWriter, contents []byte, context interface{}) error
- type ILayout
- type MustacheLayout
- func (l *MustacheLayout) LoadLayoutFile(fileName string) error
- func (l *MustacheLayout) LoadLayoutString(contents []byte) error
- func (l *MustacheLayout) RenderViewFile(fileName string, context interface{}) (string, error)
- func (l *MustacheLayout) RenderViewFilef(writer http.ResponseWriter, fileName string, context interface{}) error
- func (l *MustacheLayout) RenderViewString(contents []byte, context interface{}) (string, error)
- func (l *MustacheLayout) RenderViewStringf(writer http.ResponseWriter, contents []byte, context interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoLayout ¶
type GoLayout struct {
// contains filtered or unexported fields
}
GoLayout is a layout using Go templates
func (*GoLayout) LoadLayoutFile ¶
LoadLayoutFile loads a layout from a file
func (*GoLayout) LoadLayoutString ¶
LoadLayoutString loads a layout from a passed-in byte array
func (*GoLayout) RenderViewFile ¶
RenderViewFile renders a view from a file into this layout
func (*GoLayout) RenderViewFilef ¶
func (l *GoLayout) RenderViewFilef(writer http.ResponseWriter, fileName string, context interface{}) error
RenderViewFilef renders a view from a file into this layout, then writes it out to the provider writer. Useful for HTTP responses
func (*GoLayout) RenderViewString ¶
RenderViewString renders a view from byte array content into this layout
func (*GoLayout) RenderViewStringf ¶
func (l *GoLayout) RenderViewStringf(writer http.ResponseWriter, contents []byte, context interface{}) error
RenderViewStringf renders a view from byte array content into this layout, and writes it out to the provided writer. Useful for HTTP responses
type ILayout ¶
type ILayout interface { LoadLayoutFile(fileName string) error LoadLayoutString(contents []byte) error RenderViewFile(fileName string, context interface{}) (string, error) RenderViewFilef(writer http.ResponseWriter, fileName string, context interface{}) error RenderViewString(contents []byte, context interface{}) (string, error) RenderViewStringf(writer http.ResponseWriter, contents []byte, context interface{}) error }
ILayout defines an interface for layouts to adhere to
func NewGoLayoutFromFile ¶
NewGoLayoutFromFile creates a new Mustache-based layout from a file
func NewGoLayoutFromString ¶
NewGoLayoutFromString creates a new Mustache-based layout from a byte array
func NewMustacheLayoutFromFile ¶
NewMustacheLayoutFromFile creates a new Mustache-based layout from a file
func NewMustacheLayoutFromString ¶
NewMustacheLayoutFromString creates a new Mustache-based layout from a byte array
type MustacheLayout ¶
type MustacheLayout struct {
// contains filtered or unexported fields
}
MustacheLayout is a layout using Mustache templates
func (*MustacheLayout) LoadLayoutFile ¶
func (l *MustacheLayout) LoadLayoutFile(fileName string) error
LoadLayoutFile loads a layout from a file
func (*MustacheLayout) LoadLayoutString ¶
func (l *MustacheLayout) LoadLayoutString(contents []byte) error
LoadLayoutString loads a layout from a passed-in byte array
func (*MustacheLayout) RenderViewFile ¶
func (l *MustacheLayout) RenderViewFile(fileName string, context interface{}) (string, error)
RenderViewFile renders a view from a file into this layout
func (*MustacheLayout) RenderViewFilef ¶
func (l *MustacheLayout) RenderViewFilef(writer http.ResponseWriter, fileName string, context interface{}) error
RenderViewFilef renders a view from a file into this layout, then writes it out to the provider writer. Useful for HTTP responses
func (*MustacheLayout) RenderViewString ¶
func (l *MustacheLayout) RenderViewString(contents []byte, context interface{}) (string, error)
RenderViewString renders a view from byte array content into this layout
func (*MustacheLayout) RenderViewStringf ¶
func (l *MustacheLayout) RenderViewStringf(writer http.ResponseWriter, contents []byte, context interface{}) error
RenderViewStringf renders a view from byte array content into this layout, and writes it out to the provided writer. Useful for HTTP responses