-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathmain.go
executable file
·38 lines (30 loc) · 941 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"oss/config"
_ "oss/docs"
"oss/lib/cors"
logger "oss/lib/log"
minioService "oss/service/minio"
"github.com/gin-gonic/gin"
gs "github.com/swaggo/gin-swagger"
"github.com/swaggo/gin-swagger/swaggerFiles"
)
// @title minio-breakpoint-upload API
// @version 1.0
// @description This is a minio upload server.
// @BasePath /api/v1/
func main() {
router := gin.New()
router.Use(cors.Cors())
router.GET("/swagger/*any", gs.WrapHandler(swaggerFiles.Handler))
minio := router.Group("/minio")
{
minio.GET("/get_chunks", minioService.GetSuccessChunks)
minio.GET("/new_multipart", minioService.NewMultipart)
minio.GET("/get_multipart_url", minioService.GetMultipartUploadUrl)
minio.POST("/complete_multipart", minioService.CompleteMultipart)
minio.POST("/update_chunk", minioService.UpdateMultipart)
}
router.Run(":" + config.PORT)
logger.LOG.Infof("service is running on port:", config.PORT)
}