Documentation ¶
Index ¶
- Constants
- Variables
- func MiddlewareCookie(c *Context) error
- func MiddlewareCors(c *Context) error
- func MiddlewareRecover(c *Context) error
- func MiddlewareRequestID(c *Context) error
- func MiddlewareRequestLog(c *Context) error
- func TransformHandlers(r *app.Resource, handlers []Handler, l app.Logger) []fiber.Handler
- type Config
- type Context
- func (c *Context) Arg(name string, defaults ...string) string
- func (c *Context) ArgInt(name string, defaults ...int) int
- func (c *Context) Args() map[string]string
- func (c *Context) AuthToken() string
- func (c *Context) Base() string
- func (c *Context) Context() context.Context
- func (c *Context) Cookie(name string, values ...*Cookie) string
- func (c *Context) Entity() (*schema.Entity, error)
- func (c *Context) Files() ([]*app.File, error)
- func (c *Context) Header(key string, vals ...string) string
- func (c *Context) Hostname() string
- func (c *Context) ID() string
- func (c *Context) JSON(v any) error
- func (c *Context) Logger() app.Logger
- func (c *Context) Method() string
- func (c *Context) Next() error
- func (c *Context) OriginalURL() string
- func (c *Context) Parse(v any) error
- func (c *Context) Path() string
- func (c *Context) Redirect(path string) error
- func (c *Context) Resource() *app.Resource
- func (c *Context) Response() *Response
- func (c *Context) Result(results ...*app.Result) *app.Result
- func (c *Context) RouteName() string
- func (c *Context) Send(data []byte) error
- func (c *Context) Status(v int) *Context
- func (c *Context) User() *app.User
- func (c *Context) Value(key string, value ...any) (val any)
- type Cookie
- type Handler
- type RequestIDContextKey
- type Response
- type RestSolver
- type Router
- func (g *Router) Delete(path string, handler Handler, resources ...*app.Resource)
- func (g *Router) Get(path string, handler Handler, resources ...*app.Resource)
- func (g *Router) Group(prefix string, r *app.Resource, handlers ...Handler) *Router
- func (g *Router) Head(path string, handler Handler, resources ...*app.Resource)
- func (g *Router) Options(path string, handler Handler, resources ...*app.Resource)
- func (g *Router) Patch(path string, handler Handler, resources ...*app.Resource)
- func (g *Router) Post(path string, handler Handler, resources ...*app.Resource)
- func (g *Router) Put(path string, handler Handler, resources ...*app.Resource)
- func (g *Router) Use(handlers ...Handler)
- type Server
- func (s *Server) Delete(path string, handler Handler, resources ...*app.Resource)
- func (s *Server) Get(path string, handler Handler, resources ...*app.Resource)
- func (s *Server) Group(prefix string, r *app.Resource, handlers ...Handler) *Router
- func (s *Server) Listen(address string) error
- func (s *Server) Options(path string, handler Handler, resources ...*app.Resource)
- func (s *Server) Patch(path string, handler Handler, resources ...*app.Resource)
- func (s *Server) Post(path string, handler Handler, resources ...*app.Resource)
- func (s *Server) Put(path string, handler Handler, resources ...*app.Resource)
- func (s *Server) Static(prefix, root string, configs ...StaticConfig)
- func (s *Server) Test(req *http.Request, msTimeout ...int) (resp *http.Response, err error)
- func (s *Server) Use(handlers ...Handler)
- type StaticConfig
Constants ¶
View Source
const HeaderRequestID = "X-Request-Id"
Variables ¶
View Source
var (
ContextKeyRequestID = RequestIDContextKey(requestID)
)
Functions ¶
func MiddlewareCookie ¶
func MiddlewareCors ¶
func MiddlewareRecover ¶
func MiddlewareRequestID ¶
func MiddlewareRequestLog ¶
Types ¶
type Context ¶
type Context struct { *fiber.Ctx // contains filtered or unexported fields }
func CreateContext ¶ added in v0.0.5
func (*Context) OriginalURL ¶
type Cookie ¶
type Cookie struct { Name string `json:"name"` Value string `json:"value"` Path string `json:"path"` Domain string `json:"domain"` MaxAge int `json:"max_age"` Expires time.Time `json:"expires"` Secure bool `json:"secure"` HTTPOnly bool `json:"http_only"` SameSite string `json:"same_site"` SessionOnly bool `json:"session_only"` }
type RequestIDContextKey ¶
type RequestIDContextKey string
func (RequestIDContextKey) String ¶
func (c RequestIDContextKey) String() string
type RestSolver ¶
type RestSolver struct {
// contains filtered or unexported fields
}
func NewRestResolver ¶
func NewRestResolver( resourceManager *app.ResourcesManager, logger app.Logger, staticFSs ...*app.StaticFs, ) *RestSolver
func (*RestSolver) Server ¶ added in v0.0.5
func (r *RestSolver) Server() *Server
func (*RestSolver) Shutdown ¶ added in v0.0.5
func (r *RestSolver) Shutdown() error
func (*RestSolver) Start ¶
func (r *RestSolver) Start(address string) error
type Router ¶
type Router struct { *fiber.App // contains filtered or unexported fields }
type Server ¶
type Server struct { *fiber.App // contains filtered or unexported fields }
func (*Server) Static ¶
func (s *Server) Static(prefix, root string, configs ...StaticConfig)
type StaticConfig ¶
type StaticConfig struct { Compress bool `json:"compress"` ByteRange bool `json:"byte_range"` Browse bool `json:"browse"` Download bool `json:"download"` Index string `json:"index"` CacheDuration time.Duration `json:"cache_duration"` // Default value 10 * time.Second. MaxAge int `json:"max_age"` // Default value 0 }
Click to show internal directories.
Click to hide internal directories.