code refactor

This commit is contained in:
MaysWind
2024-08-19 00:31:32 +08:00
parent 6fcb0a2b3c
commit e86d4e05ce
73 changed files with 1404 additions and 1344 deletions
+8 -5
View File
@@ -6,17 +6,20 @@ import (
"github.com/mayswind/ezbookkeeping/pkg/errs"
)
// CliHandlerFunc represents the cli handler function
type CliHandlerFunc func(*CliContext) error
// MiddlewareHandlerFunc represents the middleware handler function
type MiddlewareHandlerFunc func(*Context)
type MiddlewareHandlerFunc func(*WebContext)
// ApiHandlerFunc represents the api handler function
type ApiHandlerFunc func(*Context) (any, *errs.Error)
type ApiHandlerFunc func(*WebContext) (any, *errs.Error)
// DataHandlerFunc represents the handler function that returns file data byte array and file name
type DataHandlerFunc func(*Context) ([]byte, string, *errs.Error)
type DataHandlerFunc func(*WebContext) ([]byte, string, *errs.Error)
// ImageHandlerFunc represents the handler function that returns image byte array and content type
type ImageHandlerFunc func(*Context) ([]byte, string, *errs.Error)
type ImageHandlerFunc func(*WebContext) ([]byte, string, *errs.Error)
// ProxyHandlerFunc represents the reverse proxy handler function
type ProxyHandlerFunc func(*Context) (*httputil.ReverseProxy, *errs.Error)
type ProxyHandlerFunc func(*WebContext) (*httputil.ReverseProxy, *errs.Error)