go fmt
This commit is contained in:
parent
47e08a196b
commit
11c35e9305
3 changed files with 16 additions and 16 deletions
|
@ -69,9 +69,9 @@ type goPluginRoute struct {
|
||||||
//
|
//
|
||||||
// Use this struct to define your plugin, then call RegisterPluginLoader:
|
// Use this struct to define your plugin, then call RegisterPluginLoader:
|
||||||
//
|
//
|
||||||
// p := GoPlugin{Name: "my-plugin"}
|
// p := GoPlugin{Name: "my-plugin"}
|
||||||
// // Define routes, template functions, etc
|
// // Define routes, template functions, etc
|
||||||
// alps.RegisterPluginLoader(p.Loader())
|
// alps.RegisterPluginLoader(p.Loader())
|
||||||
type GoPlugin struct {
|
type GoPlugin struct {
|
||||||
Name string
|
Name string
|
||||||
|
|
||||||
|
|
24
renderer.go
24
renderer.go
|
@ -35,10 +35,10 @@ type GlobalRenderData struct {
|
||||||
// BaseRenderData is the base type for templates. It should be extended with
|
// BaseRenderData is the base type for templates. It should be extended with
|
||||||
// additional template-specific fields:
|
// additional template-specific fields:
|
||||||
//
|
//
|
||||||
// type MyRenderData struct {
|
// type MyRenderData struct {
|
||||||
// BaseRenderData
|
// BaseRenderData
|
||||||
// // add additional fields here
|
// // add additional fields here
|
||||||
// }
|
// }
|
||||||
type BaseRenderData struct {
|
type BaseRenderData struct {
|
||||||
GlobalData GlobalRenderData
|
GlobalData GlobalRenderData
|
||||||
// additional plugin-specific data
|
// additional plugin-specific data
|
||||||
|
@ -61,15 +61,15 @@ type RenderData interface {
|
||||||
//
|
//
|
||||||
// It can be used by routes to pre-fill the base data:
|
// It can be used by routes to pre-fill the base data:
|
||||||
//
|
//
|
||||||
// type MyRenderData struct {
|
// type MyRenderData struct {
|
||||||
// BaseRenderData
|
// BaseRenderData
|
||||||
// // add additional fields here
|
// // add additional fields here
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// data := &MyRenderData{
|
// data := &MyRenderData{
|
||||||
// BaseRenderData: *alps.NewBaseRenderData(ctx),
|
// BaseRenderData: *alps.NewBaseRenderData(ctx),
|
||||||
// // other fields...
|
// // other fields...
|
||||||
// }
|
// }
|
||||||
func NewBaseRenderData(ectx echo.Context) *BaseRenderData {
|
func NewBaseRenderData(ectx echo.Context) *BaseRenderData {
|
||||||
ctx, isactx := ectx.(*Context)
|
ctx, isactx := ectx.(*Context)
|
||||||
|
|
||||||
|
|
|
@ -246,7 +246,7 @@ func (s *Server) Logger() echo.Logger {
|
||||||
//
|
//
|
||||||
// Use a type assertion to get it from a echo.Context:
|
// Use a type assertion to get it from a echo.Context:
|
||||||
//
|
//
|
||||||
// ctx := ectx.(*alps.Context)
|
// ctx := ectx.(*alps.Context)
|
||||||
type Context struct {
|
type Context struct {
|
||||||
echo.Context
|
echo.Context
|
||||||
Server *Server
|
Server *Server
|
||||||
|
|
Loading…
Reference in a new issue