Documentation
¶
Index ¶
- func BindAndValidate(ctx echo.Context, i any) error
- func GetFromEchoContext[T any](ctx echo.Context, key string) T
- 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)
- type Config
- type Controller
- type Server
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseConfig ¶
ParseConfig creates an instance of needed struct. It is necesary struct contains env and validate tags to be parsed correctly
func ParseConfigWithOptions ¶
ParseConfigWithOptions creates an instance of needed struct passing some env.Options. It is necesary 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)
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 Server ¶
func NewServer ¶
func NewServer( conf ServerConfig, controllers ...Controller, ) *Server
type ServerConfig ¶
Click to show internal directories.
Click to hide internal directories.