Documentation
¶
Index ¶
- Constants
- func DecodeJSON[T any]() goexpress.Middleware
- func FromParamsContext[T any](ctx context.Context) (any, T, bool)
- func NewParamsContext[T any](ctx context.Context, t T) context.Context
- func ValidateInput[T any](validate *validator.Validate) goexpress.Middleware
- type APIHandler
- type APIResponse
- type App
- type AppDependencies
- type BaseAPIHandler
- type BaseHandler
- type Handler
- type RegisterUserRequest
- type RegisterUserResponse
- type Template
- type UserAPIHandler
- type UserHandler
Constants ¶
View Source
const ( HeaderContentType = "Content-Type" MimeJSONUTF8 = "application/json; charset=utf-8" MimeHTMLUTF8 = "text/html; charset=utf-8" )
Variables ¶
This section is empty.
Functions ¶
func DecodeJSON ¶
func DecodeJSON[T any]() goexpress.Middleware
func ValidateInput ¶
func ValidateInput[T any](validate *validator.Validate) goexpress.Middleware
Types ¶
type APIHandler ¶
type APIHandler struct { Base BaseAPIHandler User UserAPIHandler }
func NewAPIHandler ¶
func NewAPIHandler(svc service.Service) *APIHandler
type APIResponse ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func NewApp ¶
func NewApp(deps *AppDependencies) *App
func (*App) SetupMiddlewares ¶
func (a *App) SetupMiddlewares()
func (*App) SetupRoutes ¶
func (a *App) SetupRoutes()
type AppDependencies ¶
type BaseAPIHandler ¶
type BaseAPIHandler struct {
// contains filtered or unexported fields
}
func NewBaseAPIHandler ¶
func NewBaseAPIHandler(svc service.BaseService) *BaseAPIHandler
func (*BaseAPIHandler) HandleHealth ¶
func (h *BaseAPIHandler) HandleHealth(w http.ResponseWriter, r *http.Request)
type BaseHandler ¶
type BaseHandler struct {
// contains filtered or unexported fields
}
func NewBaseHandler ¶
func NewBaseHandler(t *Template) *BaseHandler
func (*BaseHandler) HandleDashboard ¶
func (h *BaseHandler) HandleDashboard(w http.ResponseWriter, r *http.Request)
type RegisterUserRequest ¶
type RegisterUserResponse ¶
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
func NewTemplate ¶
func NewTemplate(cfg config.TemplateConfig) (*Template, error)
type UserAPIHandler ¶
type UserAPIHandler struct {
// contains filtered or unexported fields
}
func NewUserAPIHandler ¶
func NewUserAPIHandler(userService service.UserService) *UserAPIHandler
func (*UserAPIHandler) HandleUserRegister ¶
func (h *UserAPIHandler) HandleUserRegister(w http.ResponseWriter, r *http.Request)
type UserHandler ¶
type UserHandler struct {
// contains filtered or unexported fields
}
func NewUserHandler ¶
func NewUserHandler(t *Template) *UserHandler
func (*UserHandler) HandleRegister ¶
func (h *UserHandler) HandleRegister(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.