webpage

package
v0.0.0-...-7554954 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

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.

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.

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.

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

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

func (l *GoLayout) LoadLayoutFile(fileName string) error

LoadLayoutFile loads a layout from a file

func (*GoLayout) LoadLayoutString

func (l *GoLayout) LoadLayoutString(contents []byte) error

LoadLayoutString loads a layout from a passed-in byte array

func (*GoLayout) RenderViewFile

func (l *GoLayout) RenderViewFile(fileName string, context interface{}) (string, error)

RenderViewFile renders a view from a file into this layout

func (*GoLayout) RenderViewFilef

func (l *GoLayout) 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 (*GoLayout) RenderViewString

func (l *GoLayout) RenderViewString(contents []byte, context interface{}) (string, error)

RenderViewString renders a view from byte array content into this layout

func (*GoLayout) RenderViewStringf

func (l *GoLayout) 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

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

func NewGoLayoutFromFile(fileName string) (ILayout, error)

NewGoLayoutFromFile creates a new Mustache-based layout from a file

func NewGoLayoutFromString

func NewGoLayoutFromString(layout []byte) (ILayout, error)

NewGoLayoutFromString creates a new Mustache-based layout from a byte array

func NewMustacheLayoutFromFile

func NewMustacheLayoutFromFile(fileName string) (ILayout, error)

NewMustacheLayoutFromFile creates a new Mustache-based layout from a file

func NewMustacheLayoutFromString

func NewMustacheLayoutFromString(layout []byte) (ILayout, error)

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

Jump to

Keyboard shortcuts

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