Versions in this module Expand all Collapse all v0 v0.14.0 Apr 24, 2024 Changes in this version + type DecodeRequestFunc func(ctx context.Context, httpReq *http.Request) (req interface{}, err error) + func GinBindingRequestDecoder(instantiateFunc func() interface{}) DecodeRequestFunc + type EncodeErrorFunc func(ctx context.Context, err error, w http.ResponseWriter) + type EncodeResponseFunc func(ctx context.Context, rw http.ResponseWriter, resp interface{}) error type MvcMapping + EncodeErrorFunc func() EncodeErrorFunc + HandlerFunc func() MvcHandlerFunc v0.13.0 Feb 27, 2024 Changes in this version + const DefaultGroup + const ErrorTemplate + const FxGroupControllers + const FxGroupCustomizers + const FxGroupErrorTranslator + const HeaderACAllowCredentials + const HeaderACAllowHeaders + const HeaderACAllowMethods + const HeaderACAllowOrigin + const HeaderACExposeHeaders + const HeaderACMaxAge + const HeaderACRequestHeaders + const HeaderACRequestMethod + const HeaderAuthorization + const HeaderContentLength + const HeaderContentType + const HeaderOrigin + const HighestMiddlewareOrder + const LogKeyHttp + const LogKeyHttpBodySize + const LogKeyHttpClientIP + const LogKeyHttpErrorMsg + const LogKeyHttpMethod + const LogKeyHttpPath + const LogKeyHttpStatus + const LowestMiddlewareOrder + const MaxWebPrecedence + const MethodAny + const MinWebPrecedence + const ServerPropertiesPrefix + func BytesResponseEncoder() httptransport.EncodeResponseFunc + func BytesWriteFunc(rw http.ResponseWriter, v interface{}) error + func ContextPath(ctx context.Context) string + func CustomResponseEncoder(opts ...EncodeOptions) httptransport.EncodeResponseFunc + func DefaultErrorHandling() gin.HandlerFunc + func FxControllerProviders(targets ...interface{}) fx.Option + func FxCustomizerProviders(targets ...interface{}) fx.Option + func FxErrorTranslatorProviders(targets ...interface{}) fx.Option + func GinContext(ctx context.Context) *gin.Context + func GinContextMerger() gin.HandlerFunc + func HttpRequest(ctx context.Context) *http.Request + func JsonErrorEncoder() httptransport.ErrorEncoder + func JsonResponseEncoder() httptransport.EncodeResponseFunc + func JsonWriteFunc(rw http.ResponseWriter, v interface{}) error + func MakeEndpoint(m *mvcMetadata) endpoint.Endpoint + func MakeFuncMetadata(endpointFunc MvcHandlerFunc, validator MvcHandlerFuncValidator) *mvcMetadata + func MakeGinBindingDecodeRequestFunc(s *mvcMetadata) httptransport.DecodeRequestFunc + func MustGinContext(ctx context.Context) *gin.Context + func MustHttpRequest(ctx context.Context) *http.Request + func NewBadRequestError(err error) error + func NewBindingError(e error) error + func NewDirFS(dir string, fsys fs.FS, opts ...DirFSOption) fs.FS + func NewHttpError(sc int, err error, headers ...http.Header) error + func NewHttpGinHandlerFunc(handlerFunc http.HandlerFunc) gin.HandlerFunc + func NewKitGinHandlerFunc(s *httptransport.Server) gin.HandlerFunc + func NewOSDirFS(dir string, opts ...DirFSOption) fs.FS + func NewSimpleGinLogFormatter(logger log.ContextualLogger, defaultLevel log.LoggingLevel, ...) gin.LogFormatter + func NormalizedPath(path string) string + func OrderedFS(fsys fs.FS, defaultOrder int) fs.FS + func PropertiesAware(props *ServerProperties) gin.HandlerFunc + func SetKV(ctx context.Context, key interface{}, value interface{}) + func TextResponseEncoder() httptransport.EncodeResponseFunc + func TextWriteFunc(rw http.ResponseWriter, v interface{}) error + type BadRequestError struct + func (_ BadRequestError) StatusCode() int + func (e BadRequestError) Unwrap() error + type BindingError struct + func (_ BindingError) StatusCode() int + func (e BindingError) Unwrap() error + type BodyContainer interface + Body func() interface{} + type ConditionalMiddleware interface + Condition func() RequestMatcher + type Controller interface + Mappings func() []Mapping + type Customizer interface + Customize func(ctx context.Context, r *Registrar) error + type DirFSOption int64 + const DirFSAllowListDirectory + type EmptyRequest struct + type EncodeOption struct + ContentType string + Response interface{} + WriteFunc func(rw http.ResponseWriter, v interface{}) error + Writer http.ResponseWriter + type EncodeOptions func(opt *EncodeOption) + type EndpointMapping MvcMapping + type Engine struct + func NewEngine() *Engine + func (e *Engine) ServeHTTP(w http.ResponseWriter, r *http.Request) + type EngineOptions func(*Engine) + type ErrorTranslateFunc func(ctx context.Context, err error) error + func (fn ErrorTranslateFunc) Translate(ctx context.Context, err error) error + type ErrorTranslateMapping interface + Condition func() RequestMatcher + Matcher func() RouteMatcher + Order func() int + TranslateFunc func() ErrorTranslateFunc + func NewErrorTranslateMapping(name string, order int, matcher RouteMatcher, cond RequestMatcher, ...) ErrorTranslateMapping + type ErrorTranslator interface + Translate func(ctx context.Context, err error) error + type GinErrorHandlingCustomizer struct + func NewGinErrorHandlingCustomizer() *GinErrorHandlingCustomizer + func (c GinErrorHandlingCustomizer) Customize(ctx context.Context, r *Registrar) error + type HandlerFunc http.HandlerFunc + type Headerer interface + Headers func() http.Header + type HttpError struct + H http.Header + SC int + func (e HttpError) Headers() http.Header + func (e HttpError) MarshalJSON() ([]byte, error) + func (e HttpError) StatusCode() int + type HttpErrorResponse struct + Details map[string]string + Message string + StatusText string + type LazyHeaderWriter struct + func NewLazyHeaderWriter(w http.ResponseWriter) *LazyHeaderWriter + func (w *LazyHeaderWriter) Header() http.Header + func (w *LazyHeaderWriter) Write(p []byte) (int, error) + func (w *LazyHeaderWriter) WriteHeader(code int) + func (w *LazyHeaderWriter) WriteHeaderNow() + type LoggingCustomizer struct + func NewLoggingCustomizer(props ServerProperties) *LoggingCustomizer + func (c LoggingCustomizer) Customize(ctx context.Context, r *Registrar) error + func (c LoggingCustomizer) PostInit(_ context.Context, _ *Registrar) error + type LoggingLevelProperties struct + Level log.LoggingLevel + Method string + Pattern string + type LoggingProperties struct + DefaultLevel log.LoggingLevel + Enabled bool + Levels map[string]LoggingLevelProperties + type Mapping interface + Name func() string + type MergedFS struct + func NewMergedFS(atLeastOne fs.FS, fs ...fs.FS) *MergedFS + func (m *MergedFS) Glob(pattern string) (ret []string, err error) + func (m *MergedFS) Open(name string) (fs.File, error) + type Middleware interface + HandlerFunc func() HandlerFunc + type MiddlewareGinMapping interface + GinHandlerFunc func() gin.HandlerFunc + func NewMiddlewareGinMapping(name string, order int, matcher RouteMatcher, cond RequestMatcher, ...) MiddlewareGinMapping + type MiddlewareMapping interface + Condition func() RequestMatcher + HandlerFunc func() HandlerFunc + Matcher func() RouteMatcher + Order func() int + func NewMiddlewareMapping(name string, order int, matcher RouteMatcher, cond RequestMatcher, ...) MiddlewareMapping + type MvcHandlerFunc interface + type MvcHandlerFuncReturnMapper func(*[]reflect.Value) (interface{}, error) + type MvcHandlerFuncValidator func(f *reflect.Value) error + type MvcMapping interface + DecodeRequestFunc func() httptransport.DecodeRequestFunc + DecodeResponseFunc func() httptransport.DecodeResponseFunc + EncodeRequestFunc func() httptransport.EncodeRequestFunc + EncodeResponseFunc func() httptransport.EncodeResponseFunc + Endpoint func() endpoint.Endpoint + ErrorEncoder func() httptransport.ErrorEncoder + func NewMvcMapping(name, group, path, method string, condition RequestMatcher, ...) MvcMapping + type PostInitCustomizer interface + PostInit func(ctx context.Context, r *Registrar) error + type PriorityGinContextCustomizer struct + func NewPriorityGinContextCustomizer(properties *ServerProperties) *PriorityGinContextCustomizer + func (c PriorityGinContextCustomizer) Customize(_ context.Context, r *Registrar) error + func (c PriorityGinContextCustomizer) PriorityOrder() int + type RecoveryCustomizer struct + func NewRecoveryCustomizer() *RecoveryCustomizer + func (c RecoveryCustomizer) Customize(ctx context.Context, r *Registrar) error + type Registrar struct + func NewRegistrar(g *Engine, properties ServerProperties) *Registrar + func (r *Registrar) AddEngineOptions(opts ...EngineOptions) error + func (r *Registrar) AddGlobalMiddlewares(handlerFuncs ...gin.HandlerFunc) error + func (r *Registrar) AddOption(opt httptransport.ServerOption) error + func (r *Registrar) AddOptionWithOrder(opt httptransport.ServerOption, o int) error + func (r *Registrar) Cleanup(ctx context.Context) (err error) + func (r *Registrar) Initialize(ctx context.Context) (err error) + func (r *Registrar) MustRegister(items ...interface{}) + func (r *Registrar) Register(items ...interface{}) (err error) + func (r *Registrar) RegisterWithLifecycle(lc fx.Lifecycle, items ...interface{}) + func (r *Registrar) Run(ctx context.Context) (err error) + func (r *Registrar) ServerPort() int + func (r *Registrar) Stop(ctx context.Context) (err error) + func (r *Registrar) WarnDuplicateMiddlewares(ifWarn bool, excludedPath ...string) + type RequestMatcher interface + type RequestPreProcessor interface + Name func() RequestPreProcessorName + Process func(r *http.Request) error + type RequestPreProcessorName string + type RequestRewriter interface + HandleRewrite func(rewritten *http.Request) error + type Response struct + B interface{} + H http.Header + SC int + func (r Response) Body() interface{} + func (r Response) Headers() http.Header + func (r Response) StatusCode() int + type Route struct + Group string + Method string + Path string + type RouteMatcher interface + type RoutedMapping interface + Condition func() RequestMatcher + Group func() string + Method func() string + Path func() string + type ServerProperties struct + ContextPath string + Logging LoggingProperties + Port int + func BindServerProperties(ctx *bootstrap.ApplicationContext) ServerProperties + func NewServerProperties() *ServerProperties + type SimpleGinMapping interface + GinHandlerFunc func() gin.HandlerFunc + func NewSimpleGinMapping(name, group, path, method string, condition RequestMatcher, ...) SimpleGinMapping + type SimpleMapping interface + HandlerFunc func() HandlerFunc + func NewSimpleMapping(name, group, path, method string, condition RequestMatcher, ...) SimpleMapping + type StaticMapping interface + AddAlias func(path, filePath string) StaticMapping + Aliases func() map[string]string + Path func() string + StaticRoot func() string + type StatusCoder interface + StatusCode func() int + type TemplateMapping MvcMapping + type Validate struct + func Validator() *Validate + func (v *Validate) SetTagName(name string) + func (v *Validate) SetTranslations(trans ut.Translator, regFn func(*validator.Validate, ut.Translator) error) error + func (v *Validate) WithTagName(name string) *Validate + type ValidationErrors struct + func (_ ValidationErrors) StatusCode() int + func (e ValidationErrors) MarshalJSON() ([]byte, error) + func (e ValidationErrors) Unwrap() error