Documentation ¶
Index ¶
- func GenerateSpec(routes []Route) (*spec.Server, error)
- func ServeFile(w http.ResponseWriter, r *http.Request, filesystem fs.FS, file string) error
- type ApiHandler
- type ApiHandlerFunc
- type Body
- type Context
- type Error
- type ErrorType
- type Group
- type Handler
- type NormalHandler
- type NormalHandlerFunc
- type Response
- type Route
- type RouteGroup
- type Router
- type Server
- type ServerConfig
- type ServerGroup
- type ServerRouter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApiHandler ¶ added in v0.8.1
type ApiHandlerFunc ¶ added in v0.8.1
type Body ¶
type Body interface { validate.Validatable }
type Error ¶ added in v0.8.3
type Error struct { Code int `json:"code"` Type ErrorType `json:"type"` Message string `json:"message"` Extra any `json:"extra,omitempty"` }
func RouteNotFound ¶ added in v0.8.3
func RouteNotFound() *Error
func ValidationError ¶ added in v0.8.3
type NormalHandler ¶ added in v0.8.1
type NormalHandler struct { Method string Path string Middlewares []echo.MiddlewareFunc HandlerFunc NormalHandlerFunc }
type NormalHandlerFunc ¶ added in v0.8.1
type Response ¶ added in v0.8.3
type Response struct { Success bool `json:"success"` Data any `json:"data,omitempty"` Error *Error `json:"error,omitempty"` }
func ErrorResponse ¶ added in v0.8.3
func SuccessResponse ¶ added in v0.8.3
type RouteGroup ¶
func NewRouteGroup ¶
func NewRouteGroup(prefix string) *RouteGroup
func (*RouteGroup) Register ¶
func (r *RouteGroup) Register(handlers ...Handler)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(config *ServerConfig) *Server
func (*Server) Group ¶
func (s *Server) Group(prefix string, m ...echo.MiddlewareFunc) *ServerGroup
type ServerConfig ¶
type ServerGroup ¶
type ServerGroup struct {
// contains filtered or unexported fields
}
func (*ServerGroup) Register ¶
func (g *ServerGroup) Register(handlers ...Handler)
type ServerRouter ¶
type ServerRouter struct {
// contains filtered or unexported fields
}
func (*ServerRouter) Group ¶
func (r *ServerRouter) Group(prefix string) Group
Click to show internal directories.
Click to hide internal directories.