Documentation ¶
Index ¶
- Constants
- Variables
- func Background() http.Context
- func NewContext(ctx *fiber.Ctx) http.Context
- func NewGroup(instance *fiber.App, prefix string, ...) route.Route
- func NewRequest(ctx *Context, log log.Log, validation validatecontract.Validation) httpcontract.Request
- func NewStatus(instance *fiber.Ctx, code int) httpcontract.ResponseSuccess
- func NewSuccess(instance *fiber.Ctx) httpcontract.ResponseSuccess
- func ResponseMiddleware() httpcontract.Middleware
- type Context
- func (c *Context) Context() context.Context
- func (c *Context) Deadline() (deadline time.Time, ok bool)
- func (c *Context) Done() <-chan struct{}
- func (c *Context) Err() error
- func (c *Context) Instance() *fiber.Ctx
- func (c *Context) Request() http.Request
- func (c *Context) Response() http.Response
- func (c *Context) Value(key any) any
- func (c *Context) WithValue(key string, value any)
- type Group
- func (r *Group) Any(relativePath string, handler httpcontract.HandlerFunc)
- func (r *Group) Delete(relativePath string, handler httpcontract.HandlerFunc)
- func (r *Group) Get(relativePath string, handler httpcontract.HandlerFunc)
- func (r *Group) Group(handler route.GroupFunc)
- func (r *Group) Middleware(middlewares ...httpcontract.Middleware) route.Route
- func (r *Group) Options(relativePath string, handler httpcontract.HandlerFunc)
- func (r *Group) Patch(relativePath string, handler httpcontract.HandlerFunc)
- func (r *Group) Post(relativePath string, handler httpcontract.HandlerFunc)
- func (r *Group) Prefix(addr string) route.Route
- func (r *Group) Put(relativePath string, handler httpcontract.HandlerFunc)
- func (r *Group) Resource(relativePath string, controller httpcontract.ResourceController)
- func (r *Group) Static(relativePath, root string)
- func (r *Group) StaticFS(relativePath string, fs http.FileSystem)
- func (r *Group) StaticFile(relativePath, filepath string)
- type Request
- func (r *Request) AbortWithStatus(code int)
- func (r *Request) AbortWithStatusJson(code int, jsonObj any)
- func (r *Request) All() map[string]any
- func (r *Request) Bind(obj any) error
- func (r *Request) File(name string) (filesystemcontract.File, error)
- func (r *Request) Form(key string, defaultValue ...string) string
- func (r *Request) FullUrl() string
- func (r *Request) Header(key string, defaultValue ...string) string
- func (r *Request) Headers() http.Header
- func (r *Request) Host() string
- func (r *Request) Input(key string, defaultValue ...string) string
- func (r *Request) InputBool(key string, defaultValue ...bool) bool
- func (r *Request) InputInt(key string, defaultValue ...int) int
- func (r *Request) InputInt64(key string, defaultValue ...int64) int64
- func (r *Request) Ip() string
- func (r *Request) Json(key string, defaultValue ...string) string
- func (r *Request) Method() string
- func (r *Request) Next()
- func (r *Request) Origin() *http.Request
- func (r *Request) Path() string
- func (r *Request) Queries() map[string]string
- func (r *Request) Query(key string, defaultValue ...string) string
- func (r *Request) QueryArray(key string) []string
- func (r *Request) QueryBool(key string, defaultValue ...bool) bool
- func (r *Request) QueryInt(key string, defaultValue ...int) int
- func (r *Request) QueryInt64(key string, defaultValue ...int64) int64
- func (r *Request) QueryMap(key string) map[string]string
- func (r *Request) Route(key string) string
- func (r *Request) RouteInt(key string) int
- func (r *Request) RouteInt64(key string) int64
- func (r *Request) Url() string
- func (r *Request) Validate(rules map[string]string, options ...validatecontract.Option) (validatecontract.Validator, error)
- func (r *Request) ValidateRequest(request httpcontract.FormRequest) (validatecontract.Errors, error)
- type Response
- func (r *Response) Data(code int, contentType string, data []byte)
- func (r *Response) Download(filepath, filename string)
- func (r *Response) File(filepath string)
- func (r *Response) Flush()
- func (r *Response) Header(key, value string) httpcontract.Response
- func (r *Response) Json(code int, obj any)
- func (r *Response) Origin() httpcontract.ResponseOrigin
- func (r *Response) Redirect(code int, location string)
- func (r *Response) Status(code int) httpcontract.ResponseStatus
- func (r *Response) String(code int, format string, values ...any)
- func (r *Response) Success() httpcontract.ResponseSuccess
- func (r *Response) Writer() http.ResponseWriter
- type ResponseOrigin
- type Route
- func (r *Route) Fallback(handler httpcontract.HandlerFunc)
- func (r *Route) GlobalMiddleware(middlewares ...httpcontract.Middleware)
- func (r *Route) Run(host ...string) error
- func (r *Route) RunTLS(host ...string) error
- func (r *Route) RunTLSWithCert(host, certFile, keyFile string) error
- func (r *Route) ServeHTTP(writer http.ResponseWriter, request *http.Request)
- func (r *Route) Test(request *http.Request) (*http.Response, error)
- type ServiceProvider
- type Status
- type Success
Constants ¶
View Source
const HttpBinding = "goravel.fiber.http"
View Source
const RouteBinding = "goravel.fiber.route"
Variables ¶
View Source
var ( ConfigFacade config.Config LogFacade log.Log ValidationFacade validation.Validation )
View Source
var App foundation.Application
Functions ¶
func Background ¶
func NewContext ¶ added in v1.0.4
func NewGroup ¶ added in v1.0.4
func NewGroup(instance *fiber.App, prefix string, originMiddlewares []httpcontract.Middleware, lastMiddlewares []httpcontract.Middleware) route.Route
func NewRequest ¶ added in v1.0.4
func NewRequest(ctx *Context, log log.Log, validation validatecontract.Validation) httpcontract.Request
func NewStatus ¶ added in v1.1.4
func NewStatus(instance *fiber.Ctx, code int) httpcontract.ResponseSuccess
func NewSuccess ¶ added in v1.1.4
func NewSuccess(instance *fiber.Ctx) httpcontract.ResponseSuccess
func ResponseMiddleware ¶ added in v1.0.4
func ResponseMiddleware() httpcontract.Middleware
Types ¶
type Context ¶ added in v1.0.4
type Context struct {
// contains filtered or unexported fields
}
type Group ¶ added in v1.0.4
type Group struct {
// contains filtered or unexported fields
}
func (*Group) Any ¶ added in v1.0.4
func (r *Group) Any(relativePath string, handler httpcontract.HandlerFunc)
func (*Group) Delete ¶ added in v1.0.4
func (r *Group) Delete(relativePath string, handler httpcontract.HandlerFunc)
func (*Group) Get ¶ added in v1.0.4
func (r *Group) Get(relativePath string, handler httpcontract.HandlerFunc)
func (*Group) Middleware ¶ added in v1.0.4
func (r *Group) Middleware(middlewares ...httpcontract.Middleware) route.Route
func (*Group) Options ¶ added in v1.0.4
func (r *Group) Options(relativePath string, handler httpcontract.HandlerFunc)
func (*Group) Patch ¶ added in v1.0.4
func (r *Group) Patch(relativePath string, handler httpcontract.HandlerFunc)
func (*Group) Post ¶ added in v1.0.4
func (r *Group) Post(relativePath string, handler httpcontract.HandlerFunc)
func (*Group) Put ¶ added in v1.0.4
func (r *Group) Put(relativePath string, handler httpcontract.HandlerFunc)
func (*Group) Resource ¶ added in v1.0.4
func (r *Group) Resource(relativePath string, controller httpcontract.ResourceController)
func (*Group) StaticFS ¶ added in v1.0.4
func (r *Group) StaticFS(relativePath string, fs http.FileSystem)
func (*Group) StaticFile ¶ added in v1.0.4
type Request ¶ added in v1.0.4
type Request struct {
// contains filtered or unexported fields
}
func (*Request) AbortWithStatus ¶ added in v1.0.4
func (*Request) AbortWithStatusJson ¶ added in v1.0.4
func (*Request) File ¶ added in v1.0.4
func (r *Request) File(name string) (filesystemcontract.File, error)
func (*Request) InputInt64 ¶ added in v1.0.4
func (*Request) QueryArray ¶ added in v1.0.4
func (*Request) QueryInt64 ¶ added in v1.0.4
func (*Request) RouteInt64 ¶ added in v1.0.4
func (*Request) Validate ¶ added in v1.0.4
func (r *Request) Validate(rules map[string]string, options ...validatecontract.Option) (validatecontract.Validator, error)
func (*Request) ValidateRequest ¶ added in v1.0.4
func (r *Request) ValidateRequest(request httpcontract.FormRequest) (validatecontract.Errors, error)
type Response ¶ added in v1.0.4
type Response struct {
// contains filtered or unexported fields
}
func NewResponse ¶ added in v1.0.4
func NewResponse(instance *fiber.Ctx, origin httpcontract.ResponseOrigin) *Response
func (*Response) Header ¶ added in v1.0.4
func (r *Response) Header(key, value string) httpcontract.Response
func (*Response) Origin ¶ added in v1.0.4
func (r *Response) Origin() httpcontract.ResponseOrigin
func (*Response) Status ¶ added in v1.0.4
func (r *Response) Status(code int) httpcontract.ResponseStatus
func (*Response) Success ¶ added in v1.0.4
func (r *Response) Success() httpcontract.ResponseSuccess
func (*Response) Writer ¶ added in v1.0.4
func (r *Response) Writer() http.ResponseWriter
type ResponseOrigin ¶ added in v1.0.4
type ResponseOrigin struct {
*fiber.Ctx
}
func (*ResponseOrigin) Body ¶ added in v1.0.4
func (w *ResponseOrigin) Body() *bytes.Buffer
func (*ResponseOrigin) Header ¶ added in v1.0.4
func (w *ResponseOrigin) Header() http.Header
func (*ResponseOrigin) Size ¶ added in v1.0.4
func (w *ResponseOrigin) Size() int
func (*ResponseOrigin) Status ¶ added in v1.0.4
func (w *ResponseOrigin) Status() int
type Route ¶ added in v1.0.4
Route fiber route Route 光纤路由
func (*Route) Fallback ¶ added in v1.0.4
func (r *Route) Fallback(handler httpcontract.HandlerFunc)
Fallback set fallback handler Fallback 设置回退处理程序
func (*Route) GlobalMiddleware ¶ added in v1.0.4
func (r *Route) GlobalMiddleware(middlewares ...httpcontract.Middleware)
GlobalMiddleware set global middleware GlobalMiddleware 设置全局中间件
func (*Route) RunTLSWithCert ¶ added in v1.0.4
RunTLSWithCert run TLS server with cert file and key file RunTLSWithCert 使用证书文件和密钥文件运行 TLS 服务器
type ServiceProvider ¶
type ServiceProvider struct { }
func (*ServiceProvider) Boot ¶
func (receiver *ServiceProvider) Boot(app foundation.Application)
func (*ServiceProvider) Register ¶
func (receiver *ServiceProvider) Register(app foundation.Application)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.