Micro-DDD (Hex-Arc) RestAPI for Shell Executor
Resthell provides the ability to run a shell command with RestAPI. You can run it locally or as a container.
It has been developed with Domain Driven Design (Hex-Arc) architecture and allows you to be included in the domain and perform external operations in all microservice infrastructures without additional development processes.
Do you want to learn more information about Domain Driven Design and Hex-Arc?
Also, you can see these pictures about Domain Driven Design (Hex-Arc).
git clone https://github.com/husamettinarabaci/go-resthell.git
cd go-resthell
go mod download
go test -v ./...
POST https://localhost:18080/api/cmd HTTP/1.1
content-type: application/json
{
"command": "ls -al"
}
export LOCAL=true && go run cmd/main.go
docker build -t {DOCKER_USERNAME}/{YOUR_REPO} -f script/Dockerfile .
docker tag {DOCKER_USERNAME}/{YOUR_REPO} {DOCKER_USERNAME}/{YOUR_REPO}:latest
docker push {DOCKER_USERNAME}/{YOUR_REPO}:latest
docker run -p 18080:18080 {DOCKER_USERNAME}/{YOUR_REPO}:latest
kubectl apply -f script/k8s.yml
Fork the project and create the below secrets in your repo.
DOCKERHUB_USERNAME
DOCKERHUB_TOKEN
Create "release" branch and create a pull request to "release" branch and merge it. Github Actions will build and push docker image to your dockerhub repo.
.
├── cmd
│ └── main.go
├── config
│ ├── log_local.yml
│ ├── log.yml
│ ├── rest_local.yml
│ └── rest.yml
├── core
│ ├── application
│ │ ├── infrastructure
│ │ │ └── port
│ │ │ ├── log.go
│ │ │ └── shell.go
│ │ ├── presentation
│ │ │ ├── adapter
│ │ │ │ ├── command.go
│ │ │ │ └── query.go
│ │ │ └── port
│ │ │ ├── command.go
│ │ │ └── query.go
│ │ └── service
│ │ └── service.go
│ └── domain
│ ├── model
│ │ ├── entity
│ │ │ ├── commandrequest.go
│ │ │ └── commandresponse.go
│ │ ├── interface
│ │ │ └── loggable.go
│ │ └── object
│ │ ├── command.go
│ │ ├── error.go
│ │ └── response.go
│ └── service
│ └── service.go
├── go.mod
├── go.sum
├── LICENSE
├── pkg
│ ├── infrastructure
│ │ ├── adapter
│ │ │ ├── log.go
│ │ │ └── shell.go
│ │ └── mapper
│ │ └── command.go
│ └── presentation
│ ├── controller
│ │ └── rest
│ │ └── restapi.go
│ └── dto
│ ├── commandrequest.go
│ └── commandresponse.go
├── README.md
├── script
│ ├── Dockerfile
│ └── k8s.yml
├── TODO.md
└── tool
├── config
│ ├── log.go
│ └── rest.go
└── json
└── json.go
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
- Implement Pipe Supporting
Hüsamettin ARABACI - info@husamettinarabaci.com
Project Link: https://github.com/husamettinarabaci/go-resthell