Documentation ¶
Overview ¶
Copyright 2016 Wenhui Shen <www.webx.top>
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 2016 Wenhui Shen <www.webx.top>
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 ¶
- Variables
- func AutoOutput(options ...*Options) echo.MiddlewareFunc
- func Del(key string)
- func HTTPErrorHandler(templates map[int]string, options ...*Options) echo.HTTPErrorHandler
- func Middleware(d echo.Renderer) echo.MiddlewareFunc
- func New(key string, tmplDir string, args ...logger.Logger) Driver
- func Output(format string, c echo.Context, opt *Options) error
- func OutputError(err error, format string, c echo.Context, opt *Options) error
- func Reg(key string, val func(string) Driver)
- func SetFuncs(c echo.Context, v *echo.Data)
- type Config
- func (t *Config) ApplyTo(e *echo.Echo, manager ...driver.Manager) *Config
- func (t *Config) NewRenderer(manager ...driver.Manager) driver.Driver
- func (t *Config) NewStatic() *resource.Static
- func (t *Config) Parser() func([]byte) []byte
- func (t *Config) Renderer() driver.Driver
- func (t *Config) ThemeDir(args ...string) string
- type Options
Constants ¶
This section is empty.
Variables ¶
var ( DefaultOptions = &Options{ Skipper: echo.DefaultSkipper, DataKey: `data`, TmplKey: `tmpl`, DefaultTmpl: `index`, DefaultErrorTmpl: `error`, JSONPCallbackName: `callback`, ErrorFunc: OutputError, OutputFunc: Output, DefaultErrorHTTPCode: http.StatusInternalServerError, } )
Functions ¶
func AutoOutput ¶
func AutoOutput(options ...*Options) echo.MiddlewareFunc
AutoOutput Outputs the specified format
func HTTPErrorHandler ¶ added in v1.1.0
func HTTPErrorHandler(templates map[int]string, options ...*Options) echo.HTTPErrorHandler
func OutputError ¶
OutputError Outputs the specified format
Types ¶
type Config ¶ added in v1.1.0
type Config struct { TmplDir string Theme string Engine string Style string Reload bool ParseStrings map[string]string ErrorPages map[int]string StaticOptions *middleware.StaticOptions // contains filtered or unexported fields }
func (*Config) NewRenderer ¶ added in v1.1.1
NewRenderer 新建渲染接口
type Options ¶ added in v1.1.1
type Options struct { Skipper echo.Skipper DataKey string TmplKey string DefaultTmpl string DefaultErrorTmpl string JSONPCallbackName string ErrorFunc func(err error, format string, c echo.Context, opt *Options) error OutputFunc func(format string, c echo.Context, opt *Options) error DefaultErrorHTTPCode int }