middleware

package
v0.0.0-...-dd75de5 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: AGPL-3.0 Imports: 51 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Customer = sessdata.Customer
	URLFor   = sessdata.URLFor
)
View Source
var DefaultRenderDataWrapper = func(ctx echo.Context, data interface{}) interface{} {
	return NewRenderData(ctx, data)
}
View Source
var Middlewares []interface{}
View Source
var TmplFuncGenerator = mwutils.TmplFuncGenerators{
	`Currency`: func(ctx echo.Context) interface{} {
		return func(v float64, withFlags ...bool) interface{} {
			return xcommon.HTMLCurrency(ctx, v, withFlags...)
		}
	},
	`CurrencySymbol`: func(ctx echo.Context) interface{} {
		return func() template.HTML {
			return xcommon.HTMLCurrencySymbol(ctx)
		}
	},
}

Functions

func AuthCheck

func AuthCheck(h echo.Handler) echo.HandlerFunc

func FuncMap

func FuncMap() echo.MiddlewareFunc

func IPFilter

func IPFilter() echo.MiddlewareFuncd

func JWT

func JWT(skippers ...func(echo.Context) bool) echo.MiddlewareFuncd
func NavigateList(ctx echo.Context, m *dbschema.OfficialCommonNavigate, navType string, parentIDs ...uint) []*official.NavigateExt

func OnlyLocal

func OnlyLocal() echo.MiddlewareFuncd

func RateLimiter

func RateLimiter() echo.MiddlewareFunc

func SessionInfo

func SessionInfo(h echo.Handler) echo.HandlerFunc

func SetFunc

func SetFunc(ctx echo.Context) error

func SetTheme

func SetTheme(theme string) echo.MiddlewareFuncd

SetTheme 设置主题

func SkipCurrentURLPermCheck

func SkipCurrentURLPermCheck(h echo.Handler) echo.HandlerFunc

func TrimPathSuffix

func TrimPathSuffix(ignorePrefixes ...string) echo.MiddlewareFuncd

func Use

func Use(m ...interface{})

func UseTheme

func UseTheme(fn func(echo.Context) *ntemplate.ThemeInfo) echo.MiddlewareFuncd

UseTheme 使用系统设置的主题

Types

type RenderData

type RenderData struct {
	*echo.RenderData
	// contains filtered or unexported fields
}

func NewRenderData

func NewRenderData(ctx echo.Context, data interface{}) *RenderData

func (*RenderData) Advert

func (r *RenderData) Advert(idents ...string) interface{}

func (*RenderData) CaptchaForm

func (r *RenderData) CaptchaForm(tmpl string, args ...interface{}) template.HTML

func (*RenderData) CaptchaFormWithType

func (r *RenderData) CaptchaFormWithType(typ string, tmpl string, args ...interface{}) template.HTML

func (*RenderData) CategoryList

func (r *RenderData) CategoryList(limit int, ctype ...string) []*dbschema.OfficialCommonCategory

func (*RenderData) Customer

func (r *RenderData) Customer() *dbschema.OfficialCustomer

func (*RenderData) CustomerDetail

func (r *RenderData) CustomerDetail() *modelCustomer.CustomerAndGroup

func (*RenderData) CustomerNav

func (r *RenderData) CustomerNav(parentIDs ...uint) []*official.NavigateExt
func (r *RenderData) Friendlink(limit int, categoryIds ...uint) []*dbschema.OfficialCommonFriendlink

func (*RenderData) FrontendNav

func (r *RenderData) FrontendNav(parentIDs ...uint) []*official.NavigateExt

func (*RenderData) SQLQuery

func (r *RenderData) SQLQuery() *nsql.SQLQuery

func (*RenderData) SQLQueryLimit

func (r *RenderData) SQLQueryLimit(offset int, limit int, linkID ...int) *nsql.SQLQuery

func (*RenderData) SkipLicenseCheck

func (r *RenderData) SkipLicenseCheck() bool

func (*RenderData) SoftwareName

func (r *RenderData) SoftwareName() string

func (*RenderData) SoftwareURL

func (r *RenderData) SoftwareURL() string

func (*RenderData) SubCategoryList

func (r *RenderData) SubCategoryList(parentId int, limit int, ctype ...string) []*dbschema.OfficialCommonCategory

func (*RenderData) TagList

func (r *RenderData) TagList(group ...string) []*dbschema.OfficialCommonTags

func (*RenderData) ThemeInfo

func (r *RenderData) ThemeInfo() *ntemplate.ThemeInfo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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