Skip to content

Commit 0138e1a

Browse files
committed
first commit
0 parents  commit 0138e1a

26 files changed

+4651
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.vscode/
2+
config.yaml

CONTRIBUTING.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Contributing to Corridor
2+
3+
Thank you for your interest in contributing to Corridor! We welcome contributions of all kinds, including bug reports, feature requests, code, and documentation improvements.
4+
5+
---
6+
7+
## How to Contribute
8+
9+
### 1. Fork the Repository
10+
11+
Click the "Fork" button at the top right of the [Corridor GitHub page](https://github.com/cloudresty/corridor) to create your own copy of the repository.
12+
13+
### 2. Clone Your Fork
14+
15+
```bash
16+
git clone https://github.com/your-username/corridor.git
17+
cd corridor
18+
```
19+
20+
### 3. Create a Branch
21+
22+
Create a new branch for your changes:
23+
24+
```bash
25+
git checkout -b my-feature-or-bugfix
26+
```
27+
28+
### 4. Make Your Changes
29+
30+
- Follow the existing code style and conventions.
31+
- Add or update tests as appropriate.
32+
- Update documentation if your changes affect usage or configuration.
33+
34+
### 5. Run Tests
35+
36+
Before submitting your changes, make sure all tests pass:
37+
38+
```bash
39+
go test ./...
40+
```
41+
42+
### 6. Commit and Push
43+
44+
Commit your changes with a clear message:
45+
46+
```bash
47+
git add .
48+
git commit -m "Describe your change"
49+
git push origin my-feature-or-bugfix
50+
```
51+
52+
### 7. Open a Pull Request
53+
54+
Go to your fork on GitHub and open a pull request (PR) against the `main` branch of the upstream repository. Please include a clear description of your changes and reference any related issues.
55+
56+
---
57+
58+
## Code of Conduct
59+
60+
By participating in this project, you agree to abide by the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/).
61+
62+
---
63+
64+
## Reporting Issues
65+
66+
If you find a bug or have a feature request, please [open an issue](https://github.com/cloudresty/Corridor/issues) and provide as much detail as possible.
67+
68+
---
69+
70+
## Style Guide
71+
72+
- Use `gofmt` to format your code.
73+
- Write clear, concise commit messages.
74+
- Document exported functions and types.
75+
- Add or update unit tests for new features or bug fixes.
76+
77+
---
78+
79+
## Questions
80+
81+
If you have questions or need help, feel free to open an issue or start a discussion.
82+
83+
---
84+
85+
Thank you for helping make Corridor better!

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Cloudresty
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
BASE = cloudresty
2+
NAME = $$(awk -F'/' '{print $$(NF-0)}' <<< $$PWD)
3+
DOCKER_REPO = ${BASE}/${NAME}
4+
DOCKER_TAG = test
5+
6+
.PHONY: build run shell clean
7+
8+
help: ## Show list of make targets and their description.
9+
@grep -E '^[%a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
10+
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
11+
12+
build: ## Build a docker image locally. Requires /build/.netrc to be present.
13+
@docker build \
14+
--platform linux/amd64 \
15+
--pull \
16+
--force-rm \
17+
--tag ${DOCKER_REPO}:${DOCKER_TAG} \
18+
--file build/Dockerfile .
19+
20+
run: ## Run docker image locally.
21+
@docker run \
22+
--platform linux/amd64 \
23+
--rm \
24+
--name ${NAME} \
25+
--hostname ${NAME}-${DOCKER_TAG} \
26+
${DOCKER_REPO}:${DOCKER_TAG}
27+
28+
shell: ## Run docker image in a shell locally.
29+
@docker run \
30+
--platform linux/amd64 \
31+
--rm \
32+
--name ${NAME} \
33+
--hostname ${NAME}-${DOCKER_TAG} \
34+
--interactive \
35+
--tty \
36+
--volume $$(pwd)/app/config.yaml:/corridor/config.yaml \
37+
--entrypoint /bin/bash \
38+
${DOCKER_REPO}:${DOCKER_TAG}
39+
40+
clean: ## Remove all local docker images for the application.
41+
@if [[ $$(docker images --format '{{.Repository}}:{{.Tag}}' | grep ${DOCKER_REPO}) ]]; then docker rmi $$(docker images --format '{{.Repository}}:{{.Tag}}' | grep ${DOCKER_REPO}); else echo "INFO: No images found for '${DOCKER_REPO}'"; fi

0 commit comments

Comments
 (0)