Documentation
¶
Index ¶
- Constants
- func BindAndValidate(ctx echo.Context, i any) error
- func GetFromEchoContext[T any](ctx echo.Context, key string) T
- func I18nMiddleware(embedLocalizations embed.FS, defaultLocale i18n.Code) echo.MiddlewareFunc
- func ParseConfig[T any]() (T, error)
- func ParseConfigWithOptions[T any](opts env.Options) (T, error)
- func RegisterController(group *echo.Group, contr Controller)
- func RegisterControllers(group *echo.Group, contrs ...Controller)
- func Render(ctx echo.Context, statusCode int, t templ.Component) error
- func SessionSecretKeyMiddleware(sessionSecret SessionSecretKeyConfig) echo.MiddlewareFunc
- func SetFlash(ctx echo.Context, flash FlashMessage)
- func Validate(ctx echo.Context, i any) error
- type Config
- type Controller
- type EchoContextTemplWrapper
- func (c *EchoContextTemplWrapper) Deadline() (deadline time.Time, ok bool)
- func (c *EchoContextTemplWrapper) Done() <-chan struct{}
- func (c *EchoContextTemplWrapper) Err() error
- func (c *EchoContextTemplWrapper) GetCqrfToken() string
- func (c *EchoContextTemplWrapper) GetFlash() []FlashMessage
- func (c *EchoContextTemplWrapper) Value(key any) any
- type FlashMessage
- type SessionSecretKeyConfig
Constants ¶
View Source
const EchoContextTemplWrapperKey = "echoCtx"
View Source
const (
SessionSecretKey = "session_key"
)
Variables ¶
This section is empty.
Functions ¶
func I18nMiddleware ¶ added in v0.21.0
func ParseConfig ¶
ParseConfig creates an instance of the necessary struct. It is necessary the struct contains env and validate tags to be parsed correctly
func ParseConfigWithOptions ¶
ParseConfigWithOptions creates an instance of the necessary struct passing some env.Options. It is necessary the struct contains env and validate tags to be parsed correctly
func RegisterController ¶
func RegisterController(group *echo.Group, contr Controller)
func RegisterControllers ¶
func RegisterControllers(group *echo.Group, contrs ...Controller)
func SessionSecretKeyMiddleware ¶ added in v0.21.0
func SessionSecretKeyMiddleware(sessionSecret SessionSecretKeyConfig) echo.MiddlewareFunc
func SetFlash ¶ added in v0.21.0
func SetFlash(ctx echo.Context, flash FlashMessage)
Types ¶
type Config ¶
type Config struct {
// Environment is used to get data using ParseConfig
Environment string `env:"ENVIRONMENT" validate:"required|in:prod,dev,test"`
Port int `env:"PORT" validate:"required|min:1|max:65535"`
}
Config is a struct helper to get all configuration need by winter
type Controller ¶
type EchoContextTemplWrapper ¶ added in v0.21.0
func GetEchoTemplContext ¶ added in v0.21.0
func GetEchoTemplContext(ctx context.Context) *EchoContextTemplWrapper
func (*EchoContextTemplWrapper) Deadline ¶ added in v0.21.0
func (c *EchoContextTemplWrapper) Deadline() (deadline time.Time, ok bool)
func (*EchoContextTemplWrapper) Done ¶ added in v0.21.0
func (c *EchoContextTemplWrapper) Done() <-chan struct{}
func (*EchoContextTemplWrapper) Err ¶ added in v0.21.0
func (c *EchoContextTemplWrapper) Err() error
func (*EchoContextTemplWrapper) GetCqrfToken ¶ added in v0.21.0
func (c *EchoContextTemplWrapper) GetCqrfToken() string
func (*EchoContextTemplWrapper) GetFlash ¶ added in v0.21.0
func (c *EchoContextTemplWrapper) GetFlash() []FlashMessage
func (*EchoContextTemplWrapper) Value ¶ added in v0.21.0
func (c *EchoContextTemplWrapper) Value(key any) any
type FlashMessage ¶ added in v0.21.0
type SessionSecretKeyConfig ¶ added in v0.21.0
type SessionSecretKeyConfig struct {
SessionSecretKey string `env:"SESSION_SECRET_KEY" validate:"required"`
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
web
|
|
|
components/datetime
templ: version: v0.3.898
|
templ: version: v0.3.898 |
|
components/formerrors
templ: version: v0.3.898
|
templ: version: v0.3.898 |
|
components/formtag
templ: version: v0.3.898
|
templ: version: v0.3.898 |
|
components/icon
templui component icon - version: main installed by templui v0.70.0
|
templui component icon - version: main installed by templui v0.70.0 |
|
components/link
templ: version: v0.3.898
|
templ: version: v0.3.898 |
|
layouts
templ: version: v0.3.898
|
templ: version: v0.3.898 |
|
utils
templui util templui.go - version: main installed by templui v0.70.0
|
templui util templui.go - version: main installed by templui v0.70.0 |
Click to show internal directories.
Click to hide internal directories.