-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
216 changed files
with
21,435 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
- name: Setup golangci-lint | ||
uses: golangci/[email protected] | ||
- name: Run linter | ||
run: make lint | ||
- name: Run test coverage | ||
run: go test $(go list ./... | grep -v example | grep -v pkged.go) -coverprofile=coverage.txt -covermode=atomic | ||
- name: Upload coverage to Codecov | ||
run: bash <(curl -s https://codecov.io/bash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,9 @@ | |
|
||
# Dependency directories (remove the comment below to include it) | ||
# vendor/ | ||
|
||
.idea | ||
|
||
logs/ | ||
|
||
coverage.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
linters: | ||
disable-all: true | ||
enable: | ||
- structcheck | ||
# - errcheck | ||
# - staticcheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* | ||
|
||
- [Contributor Covenant Code of Conduct](#contributor-covenant-code-of-conduct) | ||
- [Our Pledge](#our-pledge) | ||
- [Our Standards](#our-standards) | ||
- [Our Responsibilities](#our-responsibilities) | ||
- [Scope](#scope) | ||
- [Enforcement](#enforcement) | ||
- [Attribution](#attribution) | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as | ||
contributors and maintainers pledge to making participation in our project and | ||
our community a harassment-free experience for everyone, regardless of age, | ||
body size, disability, ethnicity, gender identity and expression, level of | ||
experience, nationality, personal appearance, race, religion, or sexual | ||
identity and orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment | ||
include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or | ||
advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic | ||
address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable | ||
behavior and are expected to take appropriate and fair corrective action in | ||
response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or | ||
reject comments, commits, code, wiki edits, issues, and other contributions | ||
that are not aligned to this Code of Conduct, or to ban temporarily or | ||
permanently any contributor for other behaviors that they deem inappropriate, | ||
threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces | ||
when an individual is representing the project or its community. Examples of | ||
representing a project or community include using an official project e-mail | ||
address, posting via an official social media account, or acting as an | ||
appointed representative at an online or offline event. Representation of a | ||
project may be further defined and clarified by project maintainers. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported by contacting the project team at [email protected]. The project | ||
team will review and investigate all complaints, and will respond in a way | ||
that it deems appropriate to the circumstances. The project team is obligated | ||
to maintain confidentiality with regard to the reporter of an incident. | ||
Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good | ||
faith may face temporary or permanent repercussions as determined by other | ||
members of the project's leadership. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], | ||
version 1.4, available at | ||
[http://contributor-covenant.org/version/1/4][version]. | ||
|
||
[homepage]: http://contributor-covenant.org | ||
[version]: http://contributor-covenant.org/version/1/4/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* | ||
|
||
- [Contributing](#contributing) | ||
- [Setup](#setup) | ||
- [Making Changes](#making-changes) | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
# Contributing | ||
|
||
We'd love your help make rk-mux the very best structured Mux bootstrapper library in Go! | ||
|
||
If you'd like to add new features, please [open an issue][open-issue] | ||
describing your proposal problem; discussing feature changes ahead of time makes | ||
pull request review much smoother. In your issue, pull request, and any other | ||
communications, please remember to treat your fellow contributors with | ||
respect! We take our [code of conduct](CODE_OF_CONDUCT.md) seriously. | ||
|
||
## Setup | ||
|
||
[Fork][fork], then clone the repository: | ||
|
||
``` | ||
git clone https://github.com/rookie-ninja/rk-mux.git | ||
cd rk-mux | ||
git remote add upstream https://github.com/rookie-ninja/rk-mux.git | ||
git fetch upstream | ||
``` | ||
|
||
Install rk-mux's dependencies: | ||
|
||
``` | ||
go mod tidy | ||
``` | ||
|
||
## Making Changes | ||
|
||
Start by creating a new branch for your changes: | ||
|
||
``` | ||
git checkout master | ||
git fetch upstream | ||
git rebase upstream/master | ||
git checkout -b cool_new_feature | ||
``` | ||
|
||
Make your changes, then ensure that `make lint` and `make test` still pass. If | ||
you're satisfied with your changes, push them to your fork. | ||
|
||
``` | ||
git push origin cool_new_feature | ||
``` | ||
|
||
Then use the GitHub UI to open a pull request. | ||
|
||
At this point, you're waiting on us to review your changes. We **try** to respond | ||
to issues and pull requests within a few business days, and we may suggest some | ||
improvements or alternatives. Once your changes are approved, one of the | ||
project maintainers will merge them. | ||
|
||
We're much more likely to approve your changes if you: | ||
|
||
* Add tests for new functionality. | ||
* Write a [good commit message][commit-message]. | ||
* Maintain backward compatibility. | ||
|
||
[fork]: https://github.com/rookie-ninja/rk-mux/fork | ||
[open-issue]: https://github.com/rookie-ninja/rk-mux/issues/new | ||
[cla]: https://cla-assistant.io/rookie-ninja/rk-mux | ||
[commit-message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
.PHONY: all | ||
all: gomod test lint doctoc fmt | ||
|
||
.PHONY: lint | ||
lint: | ||
@echo "[golangci-lint] Running golangci-lint..." | ||
@golangci-lint run 2>&1 | ||
@echo "------------------------------------[Done]" | ||
|
||
.PHONY: test | ||
test: | ||
@echo "[test] Running go test..." | ||
@go test ./... -coverprofile coverage.txt 2>&1 | ||
@go tool cover -html=coverage.txt | ||
@echo "------------------------------------[Done]" | ||
|
||
.PHONY: fmt | ||
fmt: | ||
@echo "[fmt] Formatting go project..." | ||
@gofmt -s -w . 2>&1 | ||
@echo "------------------------------------[Done]" | ||
|
||
.PHONY: doctoc | ||
doctoc: | ||
@echo "[doctoc] Running doctoc..." | ||
@doctoc . 2>&1 | ||
@echo "------------------------------------[Done]" | ||
|
||
.PHONY: swag | ||
swag: | ||
@echo "[swag] Running swag..." | ||
@swag init --generalInfo boot/common_service_entry.go --output boot/assets/sw/config --parseDependency 2 --propertyStrategy camelcase | ||
@rm -rf boot/assets/sw/config/docs.go | ||
@echo "------------------------------------[Done]" | ||
|
||
.PHONY: pkger | ||
pkger: | ||
@echo "[pkger] Running pkger..." | ||
@pkger -o boot | ||
@echo "------------------------------------[Done]" | ||
|
||
.PHONY: gomod | ||
gomod: | ||
@echo "[gomod] Running go mod tidy..." | ||
@go mod tidy | ||
@echo "------------------------------------[Done]" |
Oops, something went wrong.