Skip to content

Commit

Permalink
Kubernetes Ready
Browse files Browse the repository at this point in the history
  • Loading branch information
JarcauCristian committed Jan 28, 2024
1 parent bb1b896 commit ba243ae
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN go mod download

COPY configs ./configs

RUN curl https://dl.min.io/client/mc/release/linux-amd64/mc -o mc
RUN curl https://dl.min.io/client/mc/release/linux-arm64/mc -o mc

RUN chmod +x ./mc

Expand Down
28 changes: 14 additions & 14 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func main() {

r.Use(CORSMiddleware())

r.GET("/get_all_objects", func(c *gin.Context) {
r.GET("/balancer/get_all_objects", func(c *gin.Context) {
extension, okExtension := c.GetQuery("extension")

authorization := c.Request.Header["Authorization"]
Expand Down Expand Up @@ -68,7 +68,7 @@ func main() {
}
})

r.POST("/get_objects", func(c *gin.Context) {
r.POST("/balancer/get_objects", func(c *gin.Context) {
authorization := c.Request.Header["Authorization"]

if len(authorization) == 0 {
Expand Down Expand Up @@ -114,7 +114,7 @@ func main() {
}
})

r.POST("/add_instance", func(c *gin.Context) {
r.POST("/balancer/add_instance", func(c *gin.Context) {

var instance InstanceModel
addInstanceErr := c.BindJSON(&instance)
Expand All @@ -136,7 +136,7 @@ func main() {
}
})

r.POST("/add_instances", func(c *gin.Context) {
r.POST("/balancer/add_instances", func(c *gin.Context) {

var servers ServersModel
addInstancesErr := c.BindJSON(&servers)
Expand All @@ -158,7 +158,7 @@ func main() {
}
})

r.POST("/search_by_tags", func(c *gin.Context) {
r.POST("/balancer/search_by_tags", func(c *gin.Context) {
authorization := c.Request.Header["Authorization"]

if len(authorization) == 0 {
Expand Down Expand Up @@ -202,7 +202,7 @@ func main() {
}
})

r.POST("/search_by_content_type", func(c *gin.Context) {
r.POST("/balancer/search_by_content_type", func(c *gin.Context) {

authorization := c.Request.Header["Authorization"]

Expand Down Expand Up @@ -247,7 +247,7 @@ func main() {
}
})

r.POST("/search_by_extension", func(c *gin.Context) {
r.POST("/balancer/search_by_extension", func(c *gin.Context) {

authorization := c.Request.Header["Authorization"]

Expand Down Expand Up @@ -292,7 +292,7 @@ func main() {
}
})

r.GET("/get_object", func(c *gin.Context) {
r.GET("/balancer/get_object", func(c *gin.Context) {

datasetPath, exists := c.GetQuery("dataset_path")
forever, foreverExists := c.GetQuery("forever")
Expand Down Expand Up @@ -323,7 +323,7 @@ func main() {
}
})

r.GET("/get/object", func(c *gin.Context) {
r.GET("/balancer/get/object", func(c *gin.Context) {

datasetPath, exists := c.GetQuery("path")

Expand All @@ -350,7 +350,7 @@ func main() {
}
})

r.GET("/list_location", func(c *gin.Context) {
r.GET("/balancer/list_location", func(c *gin.Context) {
path, exists := c.GetQuery("path")

if !exists {
Expand All @@ -372,7 +372,7 @@ func main() {
}
})

r.PUT("/put_object", func(c *gin.Context) {
r.PUT("/balancer/put_object", func(c *gin.Context) {
file, okFile := c.GetPostForm("file")
fileName, okFileName := c.GetPostForm("file_name")
tags, okTags := c.GetPostForm("tags")
Expand Down Expand Up @@ -406,7 +406,7 @@ func main() {
}
})

r.PUT("/upload", func(c *gin.Context) {
r.PUT("/balancer/upload", func(c *gin.Context) {

authorization := c.Request.Header["Authorization"]

Expand Down Expand Up @@ -486,7 +486,7 @@ func main() {
}
})

r.PUT("/upload_free", func(c *gin.Context) {
r.PUT("/balancer/upload_free", func(c *gin.Context) {
file, err := c.FormFile("file")
if err != nil {
c.JSON(400, gin.H{
Expand Down Expand Up @@ -542,7 +542,7 @@ func main() {
}
})

r.DELETE("/delete_path", func(c *gin.Context) {
r.DELETE("/balancer/delete_path", func(c *gin.Context) {
authorization := c.Request.Header["Authorization"]

if len(authorization) == 0 {
Expand Down

0 comments on commit ba243ae

Please sign in to comment.