Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/storj-thirdparty/gateway-dhd
Dial Home Device. Small gateway for storj protocol <> REST translation.
https://github.com/storj-thirdparty/gateway-dhd
gateway protocol-translation rest webservices
Last synced: about 2 months ago
JSON representation
Dial Home Device. Small gateway for storj protocol <> REST translation.
- Host: GitHub
- URL: https://github.com/storj-thirdparty/gateway-dhd
- Owner: storj-thirdparty
- License: apache-2.0
- Created: 2020-09-14T20:20:06.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-12-22T15:21:22.000Z (about 3 years ago)
- Last Synced: 2024-06-21T06:29:12.773Z (7 months ago)
- Topics: gateway, protocol-translation, rest, webservices
- Language: Go
- Homepage:
- Size: 92.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gateway-dhd
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/cc4244073efa46299c90ad41eb5611ce)](https://app.codacy.com/gh/storj-thirdparty/gateway-dhd?utm_source=github.com&utm_medium=referral&utm_content=storj-thirdparty/gateway-dhd&utm_campaign=Badge_Grade)
[![Go Report Card](https://goreportcard.com/badge/github.com/storj-thirdparty/gateway-dhd)](https://goreportcard.com/report/github.com/storj-thirdparty/gateway-dhd)## Overview
Dial Home Device. Small gateway for protocol translation.
It is an HTTP REST Server to stream the response from the decentralized Storj network to the client (download) & vice versa (upload). Written in Golang.
```;
Usage:
gateway-dhd [command]
Available Commands:
help Help about any command
start start the REST server
Flags:
-e, --enableDocs For generating UI documentation of the REST server
-h, --help help for gateway-dhd
-p, --port string Port number of the REST server (default "8080")
```
```start``` - Start the REST server at the specified port number specified in the ```port``` flag (default port: ```8080```).## Requirements and Install
To build from scratch, [install the latest Go](https://golang.org/doc/install#install).> Note: Ensure go modules are enabled (GO111MODULE=on)
### Option #1: clone this repo (most common)
To clone the repo
```;
$ git clone https://github.com/storj-thirdparty/gateway-dhd.git
```
Then, build the project using the following:
```;
$ cd gateway-dhd
$ go build
```
***(Optional)*** If you want to customize the Swagger UI documentation, add those UI annotations to ```gateway-dhd/cmd/start.go``` file and then build the project using the following:```;
$ go get -u github.com/swaggo/swag/cmd/swag
$ cd gateway-dhd
$ swag init -g cmd/start.go
$ go build
```### Option #2: go get into your gopath
To download the project inside your GOPATH use the following command:
```;
$ go get github.com/storj-thirdparty/gateway-dhd
```
## Run
Once you have built the project run the following commands as per your requirement:### Start the REST server at default port 8080
```;
$ ./gateway-dhd start
```
### Start the REST server at default port 8080 with Swagger UI API documentation enabled
```;
$ ./gateway-dhd start --enableDocs
```
### Start the REST server at custom port
```;
$ ./gateway-dhd start --port
```
### Start the REST server at custom port with Swagger UI API documentation enabled
```;
$ ./gateway-dhd start --port --enableDocs
```
### Get help about gateway
```;
$ ./gateway-dhd --help
```
### Get help about gateway start command and its flags
```;
$ ./gateway-dhd start --help
```
### Once the REST server has been started & if the Swagger UI documentation for this API has been enabled, then it can be accessed from the following URL in the browser
```;
$ :/swagger/index.html
(For example: localhost:8080/swagger/index.html)
```## Testing
* The project has been tested on the following operating systems:
```;
* Windows
* Version: 10 Pro
* Processor: Intel(R) Core(TM) i3-5005U CPU @ 2.00GHz 2.00GHz* macOS Catalina
* Version: 10.15.4
* Processor: 2.5 GHz Dual-Core Intel Core i5* ubuntu
* Version: 16.04 LTS
* Processor: AMD A6-7310 APU with AMD Radeon R4 Graphics × 4
```