Documentation
¶
Index ¶
- func AbortWithJsonError(ctx *gin.Context, err error)
- func AdaptMiddleware(middleware ...MiddlewareFunc) gin.HandlerFunc
- func Close(ctx context.Context, server *http.Server) error
- func EndpointsToMatches(base string, endpoints ...[][3]string) map[string]map[string]string
- func Fs(local string, emFs *embed.FS, emPath string) (http.FileSystem, error)
- func ListenAndAutoShutdown(ctx context.Context, server *http.Server, closeTimeout time.Duration) error
- func MatchOperation(base string, endpoints [][3]string, operations ...string) func(ctx *gin.Context) bool
- func ParseError(err error) (code int32, status int32, message string)
- func SetDefaultErrorParser(parser ErrorParser)
- func ShouldBindJSON(ctx *gin.Context, obj any) error
- func ShouldBindQuery(ctx *gin.Context, obj any) error
- func ShouldBindUri(ctx *gin.Context, obj any) error
- func ShouldUniverseBind(ctx *gin.Context, obj any, uri, query, body bool) error
- func ShouldUniverseBindQuery(ctx *gin.Context, obj any) error
- func ShouldUniverseBindUri(ctx *gin.Context, obj any) error
- func Start(server *http.Server) error
- func Value[T any](key string, ctx *gin.Context) (T, bool)
- func WithFormFileBytes[T any](handler func(ctx *gin.Context, file []byte, filename string) (*T, error), ...) gin.HandlerFunc
- func WithFormFileReader[T any](handler func(ctx *gin.Context, file io.Reader, filename string) (*T, error), ...) gin.HandlerFunc
- func WithHandler(h http.Handler) func(ctx *gin.Context)
- func WithJson[T any](handler func(ctx *gin.Context) (T, error)) gin.HandlerFunc
- func WithRecover(message string, handler func(ctx *gin.Context)) gin.HandlerFunc
- func WithText(handler func(ctx *gin.Context) (string, error)) gin.HandlerFunc
- type Context
- type DataResponse
- type ErrorParser
- type ErrorResponse
- type HandlerFunc
- type MiddlewareFunc
- type WithFormOption
- type WithFormOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbortWithJsonError ¶
func AdaptMiddleware ¶
func AdaptMiddleware(middleware ...MiddlewareFunc) gin.HandlerFunc
func EndpointsToMatches ¶
func ListenAndAutoShutdown ¶
func MatchOperation ¶
func SetDefaultErrorParser ¶
func SetDefaultErrorParser(parser ErrorParser)
func ShouldUniverseBind ¶
func WithFormFileBytes ¶
func WithFormFileBytes[T any](handler func(ctx *gin.Context, file []byte, filename string) (*T, error), options ...WithFormOption) gin.HandlerFunc
func WithFormFileReader ¶
func WithFormFileReader[T any](handler func(ctx *gin.Context, file io.Reader, filename string) (*T, error), options ...WithFormOption) gin.HandlerFunc
func WithRecover ¶
func WithRecover(message string, handler func(ctx *gin.Context)) gin.HandlerFunc
Types ¶
type DataResponse ¶
type ErrorResponse ¶
type HandlerFunc ¶
type MiddlewareFunc ¶
type MiddlewareFunc func(next HandlerFunc) HandlerFunc
func MiddlewareChain ¶
func MiddlewareChain(middlewares ...MiddlewareFunc) MiddlewareFunc
type WithFormOption ¶
type WithFormOption func(*WithFormOptions)
func WithFormAllowExtensions ¶
func WithFormAllowExtensions(extensions ...string) WithFormOption
func WithFormFileKey ¶
func WithFormFileKey(key string) WithFormOption
func WithFormMaxSize ¶
func WithFormMaxSize(maxSize int64) WithFormOption
type WithFormOptions ¶
type WithFormOptions struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.