Versions in this module Expand all Collapse all v0 v0.1.4 Apr 7, 2024 v0.1.3 Jan 3, 2024 v0.1.2 Dec 30, 2023 v0.1.1 Dec 28, 2023 v0.1.0 Dec 27, 2023 Changes in this version + func IsBidiStreamRequest(c *gin.Context) bool + func IsUnidiStreamRequest(c *gin.Context) bool + func NewStatsCollector() prometheus.Collector + type Attributes uint64 + func (t *Attributes) HasAll(u Attributes) bool + func (t *Attributes) HasAny(u Attributes) bool + func (t *Attributes) With(u Attributes) + type ErrorHandle = func(c *gin.Context) error + type ErrorHandler interface + Handle func(c *gin.Context) error + type ErrorResponse struct + Message string + Status int + StatusText string + type HTTPHandle = http.HandlerFunc + type HTTPHandler = http.Handler + type Handle = func(*gin.Context) + func If(match func(*gin.Context) bool, then Handle) Handle + func Only(match func(*gin.Context) bool) Handle + func OnlyLocalIP() Handle + func Per(hashRequest func(*gin.Context) string, provideHandler func() Handle) Handle + func PerIP(provideHandler func() Handle) Handle + func RequestCounting(max int, wait time.Duration) Handle + func RequestShaping(qps, slack int, latency time.Duration) Handle + func RequestThrottling(qps, burst int) Handle + type Handler interface + Handle func(c *gin.Context) + type IHandler any + type IResourceHandler interface + Kind func() string + func Alias(handler IResourceHandler, withKind string) IResourceHandler + type IRouter interface + Delete func(string, IHandler) IRouter + Get func(string, IHandler) IRouter + Group func(string) IRouter + GroupIn func(string, func(groupRouter IRouter)) IRouter + GroupRelativePath func() string + Patch func(string, IHandler) IRouter + Post func(string, IHandler) IRouter + Put func(string, IHandler) IRouter + Routes func(IHandler) IRouter + Static func(string, http.FileSystem) IRouter + Use func(...IHandler) IRouter + func NewRouter(options ...RouterOption) IRouter + type RequestAttributesType = Attributes + const RequestWithBidiStream + const RequestWithBindingForm + const RequestWithBindingHeader + const RequestWithBindingJSON + const RequestWithBindingPath + const RequestWithBindingQuery + const RequestWithGinContext + const RequestWithUnidiStream + const RequestWithValidate + type RequestBidiStream struct + func (r RequestBidiStream) Cancel() + func (r RequestBidiStream) Deadline() (deadline time.Time, ok bool) + func (r RequestBidiStream) Done() <-chan struct{} + func (r RequestBidiStream) Err() error + func (r RequestBidiStream) Read(p []byte) (n int, err error) + func (r RequestBidiStream) RecvJSON(i any) error + func (r RequestBidiStream) RecvMsg() ([]byte, error) + func (r RequestBidiStream) SendJSON(i any) error + func (r RequestBidiStream) SendMsg(data []byte) error + func (r RequestBidiStream) Value(key any) any + func (r RequestBidiStream) Write(p []byte) (n int, err error) + type RequestCollection struct + type RequestPagination struct + Page int + PerPage int + func (r RequestPagination) Limit() int + func (r RequestPagination) Offset() int + func (r RequestPagination) Paging() (limit, offset int, request bool) + type RequestUnidiStream struct + func (r RequestUnidiStream) Cancel() + func (r RequestUnidiStream) Deadline() (deadline time.Time, ok bool) + func (r RequestUnidiStream) Done() <-chan struct{} + func (r RequestUnidiStream) Err() error + func (r RequestUnidiStream) SendJSON(i any) error + func (r RequestUnidiStream) SendMsg(data []byte) error + func (r RequestUnidiStream) Value(key any) any + func (r RequestUnidiStream) Write(p []byte) (n int, err error) + type ResourceProfile struct + Kinds []string + ResourcePathRefers []string + ResourcePaths []string + Resources []string + func (p *ResourceProfile) DeepCopy() (o ResourceProfile) + func (p *ResourceProfile) PluralPath() string + func (p *ResourceProfile) Prepend(rp ResourceProfile) + func (p *ResourceProfile) SingularPath() string + type ResponseAttributesType = Attributes + const ResponseWithPage + type ResponseCollection struct + Items any + Pagination *ResponsePagination + Type string + func FullPageResponse(data any, dataTotalSize int) *ResponseCollection + func NoPageResponse(data any) *ResponseCollection + func PageResponse(page, perPage int, data any, dataTotalSize int) *ResponseCollection + func TypedResponse(typ string, data any) *ResponseCollection + type ResponseFile struct + ContentLength int64 + ContentType string + Headers map[string]string + Reader io.ReadCloser + func (r ResponseFile) Close() error + func (r ResponseFile) Render(w http.ResponseWriter) (err error) + func (r ResponseFile) WriteContentType(w http.ResponseWriter) + type ResponsePagination struct + NextPage int + Page int + Partial bool + PerPage int + Total int + TotalPage int + type Route struct + GoCaller reflect.Value + GoFunc string + GoPackage string + GoType string + RequestAttributes RequestAttributesType + RequestType reflect.Type + ResponseAttributes ResponseAttributesType + ResponseType reflect.Type + type RouteAdviceProvider interface + CanSet func(RouteAdviceReceiver) bool + Set func(RouteAdviceReceiver) + type RouteAdviceReceiver any + type RouteAuthorizeFunc func(*gin.Context, RouteProfile) int + func (fn RouteAuthorizeFunc) Authorize(c *gin.Context, p RouteProfile) int + type RouteAuthorizer interface + Authorize func(*gin.Context, RouteProfile) int + type RouteProfile struct + Collection bool + Custom bool + CustomName string + Description string + Method string + Path string + Sub bool + Summary string + func (p RouteProfile) DeepCopy() (o RouteProfile) + type Router struct + func (rt *Router) Delete(path string, handler IHandler) IRouter + func (rt *Router) Get(path string, handler IHandler) IRouter + func (rt *Router) Group(relativePath string) IRouter + func (rt *Router) GroupIn(relativePath string, doGroupRoute func(IRouter)) IRouter + func (rt *Router) GroupRelativePath() string + func (rt *Router) Patch(path string, handler IHandler) IRouter + func (rt *Router) Post(path string, handler IHandler) IRouter + func (rt *Router) Put(path string, handler IHandler) IRouter + func (rt *Router) Routes(handler IHandler) IRouter + func (rt *Router) ServeHTTP(resp http.ResponseWriter, req *http.Request) + func (rt *Router) Static(p string, fs http.FileSystem) IRouter + func (rt *Router) Use(handlers ...IHandler) IRouter + type RouterOption interface + func ExposeOpenAPI() RouterOption + func SkipLoggingPaths(paths ...string) RouterOption + func WithDefaultHandler(handler IHandler) RouterOption + func WithDefaultWriter(w io.Writer) RouterOption + func WithResourceAuthorizer(authorizer RouteAuthorizer) RouterOption + func WithRouteAdviceProviders(providers ...RouteAdviceProvider) RouterOption + type RouterOptions []RouterOption + func (opts RouterOptions) Apply(fn func(o RouterOption) bool) (rOpts RouterOptions) + type StaticHttpFile struct + Embedded bool + Listable bool + func (f StaticHttpFile) Readdir(count int) ([]os.FileInfo, error) + func (f StaticHttpFile) Stat() (fs.FileInfo, error) + type StaticHttpFileSystem struct + Embedded bool + Listable bool + func (fs StaticHttpFileSystem) Open(name string) (http.File, error) + type Validator interface + Validate func() error