Documentation ¶
Index ¶
- Constants
- Variables
- func Background() http.Context
- func GinResponseMiddleware() httpcontract.Middleware
- func NewGinContext(ctx *gin.Context) http.Context
- func NewGinRequest(ctx *GinContext, log log.Log, validation validatecontract.Validation) httpcontract.Request
- func NewGinSuccess(instance *gin.Context) httpcontract.ResponseSuccess
- type BodyWriter
- type GinContext
- func (c *GinContext) Context() context.Context
- func (c *GinContext) Deadline() (deadline time.Time, ok bool)
- func (c *GinContext) Done() <-chan struct{}
- func (c *GinContext) Err() error
- func (c *GinContext) Instance() *gin.Context
- func (c *GinContext) Request() http.Request
- func (c *GinContext) Response() http.Response
- func (c *GinContext) Value(key any) any
- func (c *GinContext) WithValue(key string, value any)
- type GinRequest
- func (r *GinRequest) AbortWithStatus(code int)
- func (r *GinRequest) AbortWithStatusJson(code int, jsonObj any)
- func (r *GinRequest) All() map[string]any
- func (r *GinRequest) Bind(obj any) error
- func (r *GinRequest) File(name string) (filesystemcontract.File, error)
- func (r *GinRequest) Form(key string, defaultValue ...string) string
- func (r *GinRequest) FullUrl() string
- func (r *GinRequest) Header(key string, defaultValue ...string) string
- func (r *GinRequest) Headers() http.Header
- func (r *GinRequest) Host() string
- func (r *GinRequest) Input(key string, defaultValue ...string) string
- func (r *GinRequest) InputBool(key string, defaultValue ...bool) bool
- func (r *GinRequest) InputInt(key string, defaultValue ...int) int
- func (r *GinRequest) InputInt64(key string, defaultValue ...int64) int64
- func (r *GinRequest) Ip() string
- func (r *GinRequest) Json(key string, defaultValue ...string) string
- func (r *GinRequest) Method() string
- func (r *GinRequest) Next()
- func (r *GinRequest) Origin() *http.Request
- func (r *GinRequest) Path() string
- func (r *GinRequest) Queries() map[string]string
- func (r *GinRequest) Query(key string, defaultValue ...string) string
- func (r *GinRequest) QueryArray(key string) []string
- func (r *GinRequest) QueryBool(key string, defaultValue ...bool) bool
- func (r *GinRequest) QueryInt(key string, defaultValue ...int) int
- func (r *GinRequest) QueryInt64(key string, defaultValue ...int64) int64
- func (r *GinRequest) QueryMap(key string) map[string]string
- func (r *GinRequest) Route(key string) string
- func (r *GinRequest) RouteInt(key string) int
- func (r *GinRequest) RouteInt64(key string) int64
- func (r *GinRequest) Url() string
- func (r *GinRequest) Validate(rules map[string]string, options ...validatecontract.Option) (validatecontract.Validator, error)
- func (r *GinRequest) ValidateRequest(request httpcontract.FormRequest) (validatecontract.Errors, error)
- type GinResponse
- func (r *GinResponse) Data(code int, contentType string, data []byte)
- func (r *GinResponse) Download(filepath, filename string)
- func (r *GinResponse) File(filepath string)
- func (r *GinResponse) Header(key, value string) httpcontract.Response
- func (r *GinResponse) Json(code int, obj any)
- func (r *GinResponse) Origin() httpcontract.ResponseOrigin
- func (r *GinResponse) Redirect(code int, location string)
- func (r *GinResponse) String(code int, format string, values ...any)
- func (r *GinResponse) Success() httpcontract.ResponseSuccess
- func (r *GinResponse) Writer() http.ResponseWriter
- type GinSuccess
- type RateLimiter
- type ServiceProvider
Constants ¶
View Source
const Binding = "goravel.http"
Variables ¶
View Source
var ( ConfigFacade config.Config CacheFacade cache.Cache LogFacade log.Log RateLimiterFacade http.RateLimiter ValidationFacade validation.Validation )
Functions ¶
func Background ¶
func GinResponseMiddleware ¶
func GinResponseMiddleware() httpcontract.Middleware
func NewGinRequest ¶
func NewGinRequest(ctx *GinContext, log log.Log, validation validatecontract.Validation) httpcontract.Request
func NewGinSuccess ¶
func NewGinSuccess(instance *gin.Context) httpcontract.ResponseSuccess
Types ¶
type BodyWriter ¶
type BodyWriter struct { gin.ResponseWriter // contains filtered or unexported fields }
func (*BodyWriter) Body ¶
func (w *BodyWriter) Body() *bytes.Buffer
func (*BodyWriter) WriteString ¶
func (w *BodyWriter) WriteString(s string) (int, error)
type GinContext ¶
type GinContext struct {
// contains filtered or unexported fields
}
func (*GinContext) Context ¶
func (c *GinContext) Context() context.Context
func (*GinContext) Done ¶
func (c *GinContext) Done() <-chan struct{}
func (*GinContext) Err ¶
func (c *GinContext) Err() error
func (*GinContext) Instance ¶
func (c *GinContext) Instance() *gin.Context
func (*GinContext) Request ¶
func (c *GinContext) Request() http.Request
func (*GinContext) Response ¶
func (c *GinContext) Response() http.Response
func (*GinContext) Value ¶
func (c *GinContext) Value(key any) any
func (*GinContext) WithValue ¶
func (c *GinContext) WithValue(key string, value any)
type GinRequest ¶
type GinRequest struct {
// contains filtered or unexported fields
}
func (*GinRequest) AbortWithStatus ¶
func (r *GinRequest) AbortWithStatus(code int)
func (*GinRequest) AbortWithStatusJson ¶
func (r *GinRequest) AbortWithStatusJson(code int, jsonObj any)
func (*GinRequest) All ¶
func (r *GinRequest) All() map[string]any
func (*GinRequest) Bind ¶
func (r *GinRequest) Bind(obj any) error
func (*GinRequest) File ¶
func (r *GinRequest) File(name string) (filesystemcontract.File, error)
func (*GinRequest) FullUrl ¶
func (r *GinRequest) FullUrl() string
func (*GinRequest) Headers ¶
func (r *GinRequest) Headers() http.Header
func (*GinRequest) Host ¶
func (r *GinRequest) Host() string
func (*GinRequest) InputBool ¶
func (r *GinRequest) InputBool(key string, defaultValue ...bool) bool
func (*GinRequest) InputInt64 ¶
func (r *GinRequest) InputInt64(key string, defaultValue ...int64) int64
func (*GinRequest) Ip ¶
func (r *GinRequest) Ip() string
func (*GinRequest) Method ¶
func (r *GinRequest) Method() string
func (*GinRequest) Next ¶
func (r *GinRequest) Next()
func (*GinRequest) Origin ¶
func (r *GinRequest) Origin() *http.Request
func (*GinRequest) Path ¶
func (r *GinRequest) Path() string
func (*GinRequest) Queries ¶
func (r *GinRequest) Queries() map[string]string
func (*GinRequest) QueryArray ¶
func (r *GinRequest) QueryArray(key string) []string
func (*GinRequest) QueryBool ¶
func (r *GinRequest) QueryBool(key string, defaultValue ...bool) bool
func (*GinRequest) QueryInt64 ¶
func (r *GinRequest) QueryInt64(key string, defaultValue ...int64) int64
func (*GinRequest) Route ¶
func (r *GinRequest) Route(key string) string
func (*GinRequest) RouteInt ¶
func (r *GinRequest) RouteInt(key string) int
func (*GinRequest) RouteInt64 ¶
func (r *GinRequest) RouteInt64(key string) int64
func (*GinRequest) Url ¶
func (r *GinRequest) Url() string
func (*GinRequest) Validate ¶
func (r *GinRequest) Validate(rules map[string]string, options ...validatecontract.Option) (validatecontract.Validator, error)
func (*GinRequest) ValidateRequest ¶
func (r *GinRequest) ValidateRequest(request httpcontract.FormRequest) (validatecontract.Errors, error)
type GinResponse ¶
type GinResponse struct {
// contains filtered or unexported fields
}
func NewGinResponse ¶
func NewGinResponse(instance *gin.Context, origin httpcontract.ResponseOrigin) *GinResponse
func (*GinResponse) Download ¶
func (r *GinResponse) Download(filepath, filename string)
func (*GinResponse) File ¶
func (r *GinResponse) File(filepath string)
func (*GinResponse) Header ¶
func (r *GinResponse) Header(key, value string) httpcontract.Response
func (*GinResponse) Json ¶
func (r *GinResponse) Json(code int, obj any)
func (*GinResponse) Origin ¶
func (r *GinResponse) Origin() httpcontract.ResponseOrigin
func (*GinResponse) Redirect ¶
func (r *GinResponse) Redirect(code int, location string)
func (*GinResponse) Success ¶
func (r *GinResponse) Success() httpcontract.ResponseSuccess
func (*GinResponse) Writer ¶
func (r *GinResponse) Writer() http.ResponseWriter
type GinSuccess ¶
type GinSuccess struct {
// contains filtered or unexported fields
}
func (*GinSuccess) Data ¶
func (r *GinSuccess) Data(contentType string, data []byte)
func (*GinSuccess) Json ¶
func (r *GinSuccess) Json(obj any)
func (*GinSuccess) String ¶
func (r *GinSuccess) String(format string, values ...any)
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
func NewRateLimiter ¶
func NewRateLimiter() *RateLimiter
func (*RateLimiter) ForWithLimits ¶
type ServiceProvider ¶
type ServiceProvider struct { }
func (*ServiceProvider) Boot ¶
func (database *ServiceProvider) Boot(app foundation.Application)
func (*ServiceProvider) Register ¶
func (database *ServiceProvider) Register(app foundation.Application)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.