Commit 37a1f262 authored by Yakubov, Sergey's avatar Yakubov, Sergey
Browse files

refactor, add swagger

parent 0becc5fd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ set (TARGET_NAME remote-data-broker)
set (exe_name "${TARGET_NAME}")

add_custom_target(remote-data-broker ALL
    COMMAND go build ${GO_OPTS} -o ${CMAKE_CURRENT_BINARY_DIR}/${exe_name} main/file_transfer.go
    COMMAND go build ${GO_OPTS} -o ${CMAKE_CURRENT_BINARY_DIR}/${exe_name} main/rdb.go
    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src
    VERBATIM)
define_property(TARGET PROPERTY EXENAME
+6 −8
Original line number Diff line number Diff line
# remote-data-brokers
# Remote Data Broker

This is a project for remote data managers that are responsible for data transfers between local storage and a distributed data management solution. 

## Getting started

To make it easy for you to get started with GitLab, here's a list of recommended next steps.

Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
Remote Data Broker a is a low-level service within NDIP 
data management solution that is responsible
for serving files to other NDIP components using HTTP protocol.

It is usually used when the files are not available locally but need to be
transferred from some other location.
 No newline at end of file
+7 −2
Original line number Diff line number Diff line
@@ -4,12 +4,17 @@ go 1.16

require (
	github.com/dgrijalva/jwt-go v3.2.0+incompatible
	github.com/go-openapi/spec v0.20.14 // indirect
	github.com/go-openapi/swag v0.22.8 // indirect
	github.com/google/uuid v1.3.0
	github.com/gorilla/mux v1.8.0
	github.com/rabbitmq/amqp091-go v1.8.1
	github.com/sirupsen/logrus v1.8.0
	github.com/spf13/viper v1.16.0
	github.com/stretchr/testify v1.8.4
	golang.org/x/sys v0.9.0 // indirect
	gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
	github.com/swaggo/gin-swagger v1.6.0 // indirect
	github.com/swaggo/http-swagger/v2 v2.0.2
	github.com/swaggo/swag v1.16.2 // indirect
	golang.org/x/tools v0.17.0 // indirect
	gopkg.in/natefinch/lumberjack.v2 v2.2.1
)
+145 −4

File changed.

Preview size limit exceeded, changes collapsed.

+16 −0
Original line number Diff line number Diff line
@@ -10,6 +10,22 @@ import (
	"remote_data_broker/utils"
)

// routeFileDelete godoc
// @Summary      File Delete
// @Description  Delete remote file. If _remotequeue_ is set, the request
// @Description will be sent to the RabbitMQ Server to be processed up by the RDB Client. In this case _asuser_ is ignored. Otherwise,
// @Description file will be deleted locally and _asuser_ will be respected
// @Accept       json
// @Produce      json
// @Param        remotequeue query string  false  "name of the remote RMQ queue to forward request to"
// @Param        asuser query bool  false  "file will be deleted by a process running a user in the provided OIDC token"
// @Param request body fileOpRequest true "query params"
// @Success      201
// @Failure      400
// @Failure      401
// @Failure      404
// @Failure      500
// @Router       /delete [delete]
func routeFileDelete(w http.ResponseWriter, r *http.Request) {
	fileOp(w, r, OpDelete)
}
Loading