Documentation
¶
Index ¶
- Constants
- Variables
- func BadRequestResponse(c *gin.Context, msg string)
- func CacheControl(maxAge time.Duration) gin.HandlerFunc
- func Dir(fs http.FileSystem) http.FileSystem
- func ExcelFile(c *gin.Context, workbook *excelize.File, filename string) (err error)
- func FailureResponse(c *gin.Context, code, msg string)
- func FailureResponseWithArgs(c *gin.Context, code, msg string, args any)
- func HandleError(c *gin.Context, e error)
- func Init()
- func InternalErrorResponse(c *gin.Context, err error)
- func RequiredResponse(c *gin.Context, name string)
- func Run(ctx context.Context)
- func StaticFS(router gin.IRouter)
- func SuccessResponse(c *gin.Context, data interface{})
- type APIResponse
Constants ¶
View Source
const (
ContentTypeXLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
)
Variables ¶
View Source
var Router *gin.Engine
Functions ¶
func BadRequestResponse ¶
func Dir ¶
func Dir(fs http.FileSystem) http.FileSystem
Dir returns a http.FileSystem that can be used by http.FileServer(). It is used internally in Router.Static(). if listDirectory == true, then it works the same as http.Dir() otherwise it returns a filesystem that prevents http.FileServer() to list the directory files.
func FailureResponse ¶
func FailureResponseWithArgs ¶
func InternalErrorResponse ¶
func RequiredResponse ¶
func SuccessResponse ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.