Documentation
¶
Overview ¶
Copyright 2017 AppNinjas LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2017 AppNinjas LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2017 AppNinjas LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2017 AppNinjas LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
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(ctx echo.Context, fileName string, context interface{}) error
- func (l *GoLayout) RenderViewString(contents []byte, context interface{}) (string, error)
- func (l *GoLayout) RenderViewStringf(ctx echo.Context, 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(ctx echo.Context, fileName string, context interface{}) error
- func (l *MustacheLayout) RenderViewString(contents []byte, context interface{}) (string, error)
- func (l *MustacheLayout) RenderViewStringf(ctx echo.Context, 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 ¶
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
type ILayout ¶
type ILayout interface { LoadLayoutFile(fileName string) error LoadLayoutString(contents []byte) error RenderViewFile(fileName string, context interface{}) (string, error) RenderViewFilef(ctx echo.Context, fileName string, context interface{}) error RenderViewString(contents []byte, context interface{}) (string, error) RenderViewStringf(ctx echo.Context, 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(ctx echo.Context, 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(ctx echo.Context, 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