Documentation
¶
Index ¶
- Constants
- Variables
- func AddTonicRouteTyped[Req any, Res any](group contractsroute.Router, openapi *docs.OpenApi, method, path string, ...) contractsroute.Action
- func Background() http.Context
- func BindMiddleware[T any]() contractshttp.HandlerFunc
- func Cors() http.Middleware
- func DefaultTemplate() (*render.HTMLProduction, error)
- func DeleteTyped[Req any, Res any](t *TonicGroup, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
- func GetRequest[T any](ctx contractshttp.Context) (T, bool)
- func GetTyped[Req any, Res any](t *TonicGroup, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
- func NewAction(method, path, handler string) contractsroute.Action
- func NewContextRequest(ctx *Context, log log.Log, validation contractsvalidate.Validation) contractshttp.ContextRequest
- func NewContextResponse(instance *gin.Context, origin contractshttp.ResponseOrigin) contractshttp.ContextResponse
- func NewGroup(config config.Config, instance gin.IRouter, prefix string, ...) contractsroute.Router
- func NewTemplate(options RenderOptions) (*render.HTMLProduction, error)
- func PatchTyped[Req any, Res any](t *TonicGroup, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
- func PostTyped[Req any, Res any](t *TonicGroup, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
- func PutTyped[Req any, Res any](t *TonicGroup, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
- func ResponseMiddleware() contractshttp.Middleware
- func Timeout(timeout time.Duration) contractshttp.Middleware
- func Tls() contractshttp.Middleware
- type Action
- type BodyWriter
- 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() *gin.Context
- func (c *Context) Request() http.ContextRequest
- func (c *Context) Response() http.ContextResponse
- func (c *Context) Value(key any) any
- func (c *Context) WithContext(ctx context.Context)
- func (c *Context) WithValue(key any, value any)
- type ContextRequest
- func (r *ContextRequest) Abort(code ...int)
- func (r *ContextRequest) AbortWithStatus(code int)
- func (r *ContextRequest) AbortWithStatusJson(code int, jsonObj any)
- func (r *ContextRequest) All() map[string]any
- func (r *ContextRequest) Bind(obj any) error
- func (r *ContextRequest) BindQuery(obj any) error
- func (r *ContextRequest) Cookie(key string, defaultValue ...string) string
- func (r *ContextRequest) File(name string) (contractsfilesystem.File, error)
- func (r *ContextRequest) Files(name string) ([]contractsfilesystem.File, error)
- func (r *ContextRequest) Form(key string, defaultValue ...string) string
- func (r *ContextRequest) FullUrl() string
- func (r *ContextRequest) HasSession() bool
- func (r *ContextRequest) Header(key string, defaultValue ...string) string
- func (r *ContextRequest) Headers() http.Header
- func (r *ContextRequest) Host() string
- func (r *ContextRequest) Info() contractshttp.Info
- func (r *ContextRequest) Input(key string, defaultValue ...string) string
- func (r *ContextRequest) InputArray(key string, defaultValue ...[]string) []string
- func (r *ContextRequest) InputBool(key string, defaultValue ...bool) bool
- func (r *ContextRequest) InputInt(key string, defaultValue ...int) int
- func (r *ContextRequest) InputInt64(key string, defaultValue ...int64) int64
- func (r *ContextRequest) InputMap(key string, defaultValue ...map[string]any) map[string]any
- func (r *ContextRequest) InputMapArray(key string, defaultValue ...[]map[string]any) []map[string]any
- func (r *ContextRequest) Ip() string
- func (r *ContextRequest) Json(key string, defaultValue ...string) string
- func (r *ContextRequest) Method() string
- func (r *ContextRequest) Name() string
- func (r *ContextRequest) Next()
- func (r *ContextRequest) Origin() *http.Request
- func (r *ContextRequest) OriginPath() string
- func (r *ContextRequest) Path() string
- func (r *ContextRequest) Queries() map[string]string
- func (r *ContextRequest) Query(key string, defaultValue ...string) string
- func (r *ContextRequest) QueryArray(key string) []string
- func (r *ContextRequest) QueryBool(key string, defaultValue ...bool) bool
- func (r *ContextRequest) QueryInt(key string, defaultValue ...int) int
- func (r *ContextRequest) QueryInt64(key string, defaultValue ...int64) int64
- func (r *ContextRequest) QueryMap(key string) map[string]string
- func (r *ContextRequest) Route(key string) string
- func (r *ContextRequest) RouteInt(key string) int
- func (r *ContextRequest) RouteInt64(key string) int64
- func (r *ContextRequest) Session() contractsession.Session
- func (r *ContextRequest) SetSession(session contractsession.Session) contractshttp.ContextRequest
- func (r *ContextRequest) Url() string
- func (r *ContextRequest) Validate(rules map[string]string, options ...contractsvalidate.Option) (contractsvalidate.Validator, error)
- func (r *ContextRequest) ValidateRequest(request contractshttp.FormRequest) (contractsvalidate.Errors, error)
- type ContextResponse
- func (r *ContextResponse) Cookie(cookie contractshttp.Cookie) contractshttp.ContextResponse
- func (r *ContextResponse) Data(code int, contentType string, data []byte) contractshttp.AbortableResponse
- func (r *ContextResponse) Download(filepath, filename string) contractshttp.Response
- func (r *ContextResponse) File(filepath string) contractshttp.Response
- func (r *ContextResponse) Flush()
- func (r *ContextResponse) Header(key, value string) contractshttp.ContextResponse
- func (r *ContextResponse) Json(code int, obj any) contractshttp.AbortableResponse
- func (r *ContextResponse) NoContent(code ...int) contractshttp.AbortableResponse
- func (r *ContextResponse) Origin() contractshttp.ResponseOrigin
- func (r *ContextResponse) Redirect(code int, location string) contractshttp.AbortableResponse
- func (r *ContextResponse) Status(code int) contractshttp.ResponseStatus
- func (r *ContextResponse) Stream(code int, step func(w contractshttp.StreamWriter) error) contractshttp.Response
- func (r *ContextResponse) String(code int, format string, values ...any) contractshttp.AbortableResponse
- func (r *ContextResponse) Success() contractshttp.ResponseStatus
- func (r *ContextResponse) View() contractshttp.ResponseView
- func (r *ContextResponse) WithoutCookie(name string) contractshttp.ContextResponse
- func (r *ContextResponse) Writer() http.ResponseWriter
- type DataResponse
- type Delims
- type DownloadResponse
- type FileResponse
- type Group
- func (r *Group) AddTonicRoute(openapi *docs.OpenApi, method, path string, ...) contractsroute.Action
- func (r *Group) Any(path string, handler contractshttp.HandlerFunc) contractsroute.Action
- func (r *Group) Delete(path string, handler contractshttp.HandlerFunc) contractsroute.Action
- func (r *Group) Get(path string, handler contractshttp.HandlerFunc) contractsroute.Action
- func (r *Group) Group(handler contractsroute.GroupFunc)
- func (r *Group) Middleware(middlewares ...contractshttp.Middleware) contractsroute.Router
- func (r *Group) Options(path string, handler contractshttp.HandlerFunc) contractsroute.Action
- func (r *Group) Patch(path string, handler contractshttp.HandlerFunc) contractsroute.Action
- func (r *Group) Post(path string, handler contractshttp.HandlerFunc) contractsroute.Action
- func (r *Group) Prefix(path string) contractsroute.Router
- func (r *Group) Put(path string, handler contractshttp.HandlerFunc) contractsroute.Action
- func (r *Group) Resource(path string, controller contractshttp.ResourceController) contractsroute.Action
- func (r *Group) Static(path, root string) contractsroute.Action
- func (r *Group) StaticFS(path string, fs http.FileSystem) contractsroute.Action
- func (r *Group) StaticFile(path, filepath string) contractsroute.Action
- func (r *Group) TonicDelete(openapi *docs.OpenApi, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
- func (r *Group) TonicGet(openapi *docs.OpenApi, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
- func (r *Group) TonicPatch(openapi *docs.OpenApi, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
- func (r *Group) TonicPost(openapi *docs.OpenApi, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
- func (r *Group) TonicPut(openapi *docs.OpenApi, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
- func (r *Group) WithMiddlewares() gin.IRoutes
- func (r *Group) WithTonic(openapi *docs.OpenApi) *TonicGroup
- type HtmlResponse
- type JsonResponse
- type NoContentResponse
- type RedirectResponse
- type RenderOptions
- type Route
- func (r *Route) Fallback(handler contractshttp.HandlerFunc)
- func (r *Route) GetRoutes() []contractshttp.Info
- func (r *Route) GlobalMiddleware(middlewares ...contractshttp.Middleware)
- func (r *Route) Info(name string) contractshttp.Info
- func (r *Route) Listen(l net.Listener) error
- func (r *Route) ListenTLS(l net.Listener) error
- func (r *Route) ListenTLSWithCert(l net.Listener, certFile, keyFile string) error
- func (r *Route) Recover(callback func(ctx contractshttp.Context, err any))
- 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) Shutdown(ctx ...context.Context) error
- func (r *Route) Test(request *http.Request) (*http.Response, error)
- type ServiceProvider
- type Status
- func (r *Status) Data(contentType string, data []byte) contractshttp.AbortableResponse
- func (r *Status) Json(obj any) contractshttp.AbortableResponse
- func (r *Status) Stream(step func(w contractshttp.StreamWriter) error) contractshttp.Response
- func (r *Status) String(format string, values ...any) contractshttp.AbortableResponse
- type StreamResponse
- type StreamWriter
- type StringResponse
- type TonicGroup
- func (t *TonicGroup) Delete(path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
- func (t *TonicGroup) Get(path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
- func (t *TonicGroup) Options(path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
- func (t *TonicGroup) Patch(path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
- func (t *TonicGroup) Post(path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
- func (t *TonicGroup) Put(path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
- type TonicRoute
- type View
Constants ¶
const BindingOpenApi = "goravel.ginx.openapi"
const BindingRoute = "goravel.ginx.route"
Variables ¶
var ( App foundation.Application ConfigFacade config.Config LogFacade log.Log ValidationFacade validation.Validation ViewFacade http.View OpenApiInstance *docs.OpenApi )
Functions ¶
func AddTonicRouteTyped ¶
func AddTonicRouteTyped[Req any, Res any](group contractsroute.Router, openapi *docs.OpenApi, method, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
AddTonicRouteTyped adds a route with typed request/response for Tonic documentation
func Background ¶
func BindMiddleware ¶
func BindMiddleware[T any]() contractshttp.HandlerFunc
BindMiddleware creates a middleware that binds and validates request data using Gin's binding
func Cors ¶
func Cors() http.Middleware
func DefaultTemplate ¶
func DefaultTemplate() (*render.HTMLProduction, error)
DefaultTemplate creates a TemplateRender instance with default options.
func DeleteTyped ¶
func DeleteTyped[Req any, Res any](t *TonicGroup, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
DeleteTyped adds a typed DELETE route with Tonic documentation
func GetRequest ¶
func GetRequest[T any](ctx contractshttp.Context) (T, bool)
GetRequest retrieves the bound request data from context
func GetTyped ¶
func GetTyped[Req any, Res any](t *TonicGroup, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
GetTyped adds a typed GET route with Tonic documentation
func NewAction ¶
func NewAction(method, path, handler string) contractsroute.Action
func NewContextRequest ¶
func NewContextRequest(ctx *Context, log log.Log, validation contractsvalidate.Validation) contractshttp.ContextRequest
func NewContextResponse ¶
func NewContextResponse(instance *gin.Context, origin contractshttp.ResponseOrigin) contractshttp.ContextResponse
func NewGroup ¶
func NewGroup(config config.Config, instance gin.IRouter, prefix string, middlewares []contractshttp.Middleware, lastMiddlewares []contractshttp.Middleware) contractsroute.Router
func NewTemplate ¶
func NewTemplate(options RenderOptions) (*render.HTMLProduction, error)
func PatchTyped ¶
func PatchTyped[Req any, Res any](t *TonicGroup, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
PatchTyped adds a typed PATCH route with Tonic documentation
func PostTyped ¶
func PostTyped[Req any, Res any](t *TonicGroup, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
PostTyped adds a typed POST route with Tonic documentation
func PutTyped ¶
func PutTyped[Req any, Res any](t *TonicGroup, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
PutTyped adds a typed PUT route with Tonic documentation
func ResponseMiddleware ¶
func ResponseMiddleware() contractshttp.Middleware
func Timeout ¶
func Timeout(timeout time.Duration) contractshttp.Middleware
Timeout creates middleware to set a timeout for a request
func Tls ¶
func Tls() contractshttp.Middleware
Types ¶
type BodyWriter ¶
type BodyWriter struct {
gin.ResponseWriter
// contains filtered or unexported fields
}
func (*BodyWriter) Body ¶
func (w *BodyWriter) Body() *bytes.Buffer
func (*BodyWriter) Header ¶
func (w *BodyWriter) Header() http.Header
func (*BodyWriter) WriteString ¶
func (w *BodyWriter) WriteString(s string) (int, error)
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
func (*Context) Request ¶
func (c *Context) Request() http.ContextRequest
func (*Context) Response ¶
func (c *Context) Response() http.ContextResponse
func (*Context) WithContext ¶
type ContextRequest ¶
type ContextRequest struct {
// contains filtered or unexported fields
}
func (*ContextRequest) Abort ¶
func (r *ContextRequest) Abort(code ...int)
func (*ContextRequest) AbortWithStatus ¶
func (r *ContextRequest) AbortWithStatus(code int)
DEPRECATED: Use Abort instead.
func (*ContextRequest) AbortWithStatusJson ¶
func (r *ContextRequest) AbortWithStatusJson(code int, jsonObj any)
DEPRECATED: Use Response().Json().Abort() instead.
func (*ContextRequest) All ¶
func (r *ContextRequest) All() map[string]any
func (*ContextRequest) Bind ¶
func (r *ContextRequest) Bind(obj any) error
func (*ContextRequest) BindQuery ¶
func (r *ContextRequest) BindQuery(obj any) error
func (*ContextRequest) Cookie ¶
func (r *ContextRequest) Cookie(key string, defaultValue ...string) string
func (*ContextRequest) File ¶
func (r *ContextRequest) File(name string) (contractsfilesystem.File, error)
func (*ContextRequest) Files ¶
func (r *ContextRequest) Files(name string) ([]contractsfilesystem.File, error)
func (*ContextRequest) Form ¶
func (r *ContextRequest) Form(key string, defaultValue ...string) string
func (*ContextRequest) FullUrl ¶
func (r *ContextRequest) FullUrl() string
func (*ContextRequest) HasSession ¶
func (r *ContextRequest) HasSession() bool
func (*ContextRequest) Header ¶
func (r *ContextRequest) Header(key string, defaultValue ...string) string
func (*ContextRequest) Headers ¶
func (r *ContextRequest) Headers() http.Header
func (*ContextRequest) Host ¶
func (r *ContextRequest) Host() string
func (*ContextRequest) Info ¶
func (r *ContextRequest) Info() contractshttp.Info
func (*ContextRequest) Input ¶
func (r *ContextRequest) Input(key string, defaultValue ...string) string
func (*ContextRequest) InputArray ¶
func (r *ContextRequest) InputArray(key string, defaultValue ...[]string) []string
func (*ContextRequest) InputBool ¶
func (r *ContextRequest) InputBool(key string, defaultValue ...bool) bool
func (*ContextRequest) InputInt ¶
func (r *ContextRequest) InputInt(key string, defaultValue ...int) int
func (*ContextRequest) InputInt64 ¶
func (r *ContextRequest) InputInt64(key string, defaultValue ...int64) int64
func (*ContextRequest) InputMapArray ¶
func (*ContextRequest) Ip ¶
func (r *ContextRequest) Ip() string
func (*ContextRequest) Json ¶
func (r *ContextRequest) Json(key string, defaultValue ...string) string
func (*ContextRequest) Method ¶
func (r *ContextRequest) Method() string
func (*ContextRequest) Name ¶
func (r *ContextRequest) Name() string
func (*ContextRequest) Next ¶
func (r *ContextRequest) Next()
func (*ContextRequest) Origin ¶
func (r *ContextRequest) Origin() *http.Request
func (*ContextRequest) OriginPath ¶
func (r *ContextRequest) OriginPath() string
func (*ContextRequest) Path ¶
func (r *ContextRequest) Path() string
func (*ContextRequest) Queries ¶
func (r *ContextRequest) Queries() map[string]string
func (*ContextRequest) Query ¶
func (r *ContextRequest) Query(key string, defaultValue ...string) string
func (*ContextRequest) QueryArray ¶
func (r *ContextRequest) QueryArray(key string) []string
func (*ContextRequest) QueryBool ¶
func (r *ContextRequest) QueryBool(key string, defaultValue ...bool) bool
func (*ContextRequest) QueryInt ¶
func (r *ContextRequest) QueryInt(key string, defaultValue ...int) int
func (*ContextRequest) QueryInt64 ¶
func (r *ContextRequest) QueryInt64(key string, defaultValue ...int64) int64
func (*ContextRequest) Route ¶
func (r *ContextRequest) Route(key string) string
func (*ContextRequest) RouteInt ¶
func (r *ContextRequest) RouteInt(key string) int
func (*ContextRequest) RouteInt64 ¶
func (r *ContextRequest) RouteInt64(key string) int64
func (*ContextRequest) Session ¶
func (r *ContextRequest) Session() contractsession.Session
func (*ContextRequest) SetSession ¶
func (r *ContextRequest) SetSession(session contractsession.Session) contractshttp.ContextRequest
func (*ContextRequest) Url ¶
func (r *ContextRequest) Url() string
func (*ContextRequest) Validate ¶
func (r *ContextRequest) Validate(rules map[string]string, options ...contractsvalidate.Option) (contractsvalidate.Validator, error)
func (*ContextRequest) ValidateRequest ¶
func (r *ContextRequest) ValidateRequest(request contractshttp.FormRequest) (contractsvalidate.Errors, error)
type ContextResponse ¶
type ContextResponse struct {
// contains filtered or unexported fields
}
func (*ContextResponse) Cookie ¶
func (r *ContextResponse) Cookie(cookie contractshttp.Cookie) contractshttp.ContextResponse
func (*ContextResponse) Data ¶
func (r *ContextResponse) Data(code int, contentType string, data []byte) contractshttp.AbortableResponse
func (*ContextResponse) Download ¶
func (r *ContextResponse) Download(filepath, filename string) contractshttp.Response
func (*ContextResponse) File ¶
func (r *ContextResponse) File(filepath string) contractshttp.Response
func (*ContextResponse) Flush ¶
func (r *ContextResponse) Flush()
func (*ContextResponse) Header ¶
func (r *ContextResponse) Header(key, value string) contractshttp.ContextResponse
func (*ContextResponse) Json ¶
func (r *ContextResponse) Json(code int, obj any) contractshttp.AbortableResponse
func (*ContextResponse) NoContent ¶
func (r *ContextResponse) NoContent(code ...int) contractshttp.AbortableResponse
func (*ContextResponse) Origin ¶
func (r *ContextResponse) Origin() contractshttp.ResponseOrigin
func (*ContextResponse) Redirect ¶
func (r *ContextResponse) Redirect(code int, location string) contractshttp.AbortableResponse
func (*ContextResponse) Status ¶
func (r *ContextResponse) Status(code int) contractshttp.ResponseStatus
func (*ContextResponse) Stream ¶
func (r *ContextResponse) Stream(code int, step func(w contractshttp.StreamWriter) error) contractshttp.Response
func (*ContextResponse) String ¶
func (r *ContextResponse) String(code int, format string, values ...any) contractshttp.AbortableResponse
func (*ContextResponse) Success ¶
func (r *ContextResponse) Success() contractshttp.ResponseStatus
func (*ContextResponse) View ¶
func (r *ContextResponse) View() contractshttp.ResponseView
func (*ContextResponse) WithoutCookie ¶
func (r *ContextResponse) WithoutCookie(name string) contractshttp.ContextResponse
func (*ContextResponse) Writer ¶
func (r *ContextResponse) Writer() http.ResponseWriter
type DataResponse ¶
type DataResponse struct {
// contains filtered or unexported fields
}
func (*DataResponse) Abort ¶
func (r *DataResponse) Abort() error
func (*DataResponse) Render ¶
func (r *DataResponse) Render() error
type DownloadResponse ¶
type DownloadResponse struct {
// contains filtered or unexported fields
}
func (*DownloadResponse) Render ¶
func (r *DownloadResponse) Render() error
type FileResponse ¶
type FileResponse struct {
// contains filtered or unexported fields
}
func (*FileResponse) Render ¶
func (r *FileResponse) Render() error
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (*Group) AddTonicRoute ¶
func (r *Group) AddTonicRoute(openapi *docs.OpenApi, method, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
AddTonicRoute adds a route with Tonic documentation support (legacy method)
func (*Group) Any ¶
func (r *Group) Any(path string, handler contractshttp.HandlerFunc) contractsroute.Action
func (*Group) Delete ¶
func (r *Group) Delete(path string, handler contractshttp.HandlerFunc) contractsroute.Action
func (*Group) Get ¶
func (r *Group) Get(path string, handler contractshttp.HandlerFunc) contractsroute.Action
func (*Group) Group ¶
func (r *Group) Group(handler contractsroute.GroupFunc)
func (*Group) Middleware ¶
func (r *Group) Middleware(middlewares ...contractshttp.Middleware) contractsroute.Router
func (*Group) Options ¶
func (r *Group) Options(path string, handler contractshttp.HandlerFunc) contractsroute.Action
func (*Group) Patch ¶
func (r *Group) Patch(path string, handler contractshttp.HandlerFunc) contractsroute.Action
func (*Group) Post ¶
func (r *Group) Post(path string, handler contractshttp.HandlerFunc) contractsroute.Action
func (*Group) Put ¶
func (r *Group) Put(path string, handler contractshttp.HandlerFunc) contractsroute.Action
func (*Group) Resource ¶
func (r *Group) Resource(path string, controller contractshttp.ResourceController) contractsroute.Action
func (*Group) StaticFS ¶
func (r *Group) StaticFS(path string, fs http.FileSystem) contractsroute.Action
func (*Group) StaticFile ¶
func (r *Group) StaticFile(path, filepath string) contractsroute.Action
func (*Group) TonicDelete ¶
func (r *Group) TonicDelete(openapi *docs.OpenApi, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
TonicDelete adds a DELETE route with Tonic documentation
func (*Group) TonicGet ¶
func (r *Group) TonicGet(openapi *docs.OpenApi, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
TonicGet adds a GET route with Tonic documentation
func (*Group) TonicPatch ¶
func (r *Group) TonicPatch(openapi *docs.OpenApi, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
TonicPatch adds a PATCH route with Tonic documentation
func (*Group) TonicPost ¶
func (r *Group) TonicPost(openapi *docs.OpenApi, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
TonicPost adds a POST route with Tonic documentation
func (*Group) TonicPut ¶
func (r *Group) TonicPut(openapi *docs.OpenApi, path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
TonicPut adds a PUT route with Tonic documentation
func (*Group) WithMiddlewares ¶
type HtmlResponse ¶
type HtmlResponse struct {
// contains filtered or unexported fields
}
func (*HtmlResponse) Render ¶
func (r *HtmlResponse) Render() error
type JsonResponse ¶
type JsonResponse struct {
// contains filtered or unexported fields
}
func (*JsonResponse) Abort ¶
func (r *JsonResponse) Abort() error
func (*JsonResponse) Render ¶
func (r *JsonResponse) Render() error
type NoContentResponse ¶
type NoContentResponse struct {
// contains filtered or unexported fields
}
func (*NoContentResponse) Abort ¶
func (r *NoContentResponse) Abort() error
func (*NoContentResponse) Render ¶
func (r *NoContentResponse) Render() error
type RedirectResponse ¶
type RedirectResponse struct {
// contains filtered or unexported fields
}
func (*RedirectResponse) Abort ¶
func (r *RedirectResponse) Abort() error
func (*RedirectResponse) Render ¶
func (r *RedirectResponse) Render() error
type RenderOptions ¶
type Route ¶
func (*Route) Fallback ¶
func (r *Route) Fallback(handler contractshttp.HandlerFunc)
func (*Route) GetRoutes ¶
func (r *Route) GetRoutes() []contractshttp.Info
func (*Route) GlobalMiddleware ¶
func (r *Route) GlobalMiddleware(middlewares ...contractshttp.Middleware)
func (*Route) ListenTLSWithCert ¶
func (*Route) RunTLSWithCert ¶
type ServiceProvider ¶
type ServiceProvider struct{}
func (*ServiceProvider) Boot ¶
func (r *ServiceProvider) Boot(app foundation.Application)
func (*ServiceProvider) Register ¶
func (r *ServiceProvider) Register(app foundation.Application)
func (*ServiceProvider) Relationship ¶
func (r *ServiceProvider) Relationship() binding.Relationship
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
func (*Status) Data ¶
func (r *Status) Data(contentType string, data []byte) contractshttp.AbortableResponse
func (*Status) Json ¶
func (r *Status) Json(obj any) contractshttp.AbortableResponse
func (*Status) Stream ¶
func (r *Status) Stream(step func(w contractshttp.StreamWriter) error) contractshttp.Response
func (*Status) String ¶
func (r *Status) String(format string, values ...any) contractshttp.AbortableResponse
type StreamResponse ¶
type StreamResponse struct {
// contains filtered or unexported fields
}
func (*StreamResponse) Render ¶
func (r *StreamResponse) Render() error
type StreamWriter ¶
type StreamWriter struct {
// contains filtered or unexported fields
}
func NewStreamWriter ¶
func NewStreamWriter(instance *gin.Context) *StreamWriter
func (*StreamWriter) Flush ¶
func (w *StreamWriter) Flush() error
func (*StreamWriter) WriteString ¶
func (w *StreamWriter) WriteString(s string) (int, error)
type StringResponse ¶
type StringResponse struct {
// contains filtered or unexported fields
}
func (*StringResponse) Abort ¶
func (r *StringResponse) Abort() error
func (*StringResponse) Render ¶
func (r *StringResponse) Render() error
type TonicGroup ¶
type TonicGroup struct {
*Group
// contains filtered or unexported fields
}
TonicGroup wraps a Group with Tonic documentation support
func (*TonicGroup) Delete ¶
func (t *TonicGroup) Delete(path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
Delete adds a DELETE route with Tonic documentation
func (*TonicGroup) Get ¶
func (t *TonicGroup) Get(path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
Get adds a GET route with Tonic documentation
func (*TonicGroup) Options ¶
func (t *TonicGroup) Options(path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
Options adds an OPTIONS route with Tonic documentation
func (*TonicGroup) Patch ¶
func (t *TonicGroup) Patch(path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
Patch adds a PATCH route with Tonic documentation
func (*TonicGroup) Post ¶
func (t *TonicGroup) Post(path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
Post adds a POST route with Tonic documentation
func (*TonicGroup) Put ¶
func (t *TonicGroup) Put(path string, handlers ...contractshttp.HandlerFunc) contractsroute.Action
Put adds a PUT route with Tonic documentation
type TonicRoute ¶
type TonicRoute struct {
Method string
Path string
Handlers []contractshttp.HandlerFunc
}
TonicRoute represents a Tonic-enabled route configuration