Skip to content

Commit 8dd2275

Browse files
authored
feat(httpserver): Provided module (#13)
1 parent ab6e431 commit 8dd2275

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+7774
-11
lines changed

.github/workflows/common-ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,18 @@ jobs:
1919
tests:
2020
runs-on: ubuntu-latest
2121
steps:
22-
- name: Checkout repo
22+
- name: Checkout
2323
uses: actions/checkout@v3
2424
with:
2525
fetch-depth: 1
26-
- name: Set up Go
26+
- name: Install Go
2727
uses: actions/setup-go@v4
2828
with:
2929
go-version: ${{ inputs.go_version }}
30-
- name: Download modules
30+
- name: Clean cache
31+
working-directory: ${{ inputs.module }}
32+
run: go clean -modcache && go clean -testcache && go mod tidy
33+
- name: Install dependencies
3134
working-directory: ${{ inputs.module }}
3235
run: go mod download
3336
- name: Run tests
@@ -44,7 +47,7 @@ jobs:
4447
lint:
4548
runs-on: ubuntu-latest
4649
steps:
47-
- name: Checkout repo
50+
- name: Checkout
4851
uses: actions/checkout@v3
4952
with:
5053
fetch-depth: 1

.github/workflows/coverage.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,33 @@ permissions:
1717

1818
jobs:
1919
coverage:
20+
runs-on: ubuntu-latest
2021
strategy:
2122
matrix:
2223
module:
2324
- "config"
2425
- "generate"
2526
- "healthcheck"
2627
- "httpclient"
28+
- "httpserver"
2729
- "log"
2830
- "trace"
29-
30-
runs-on: ubuntu-latest
3131
steps:
32-
- name: Checkout repo
32+
- name: Checkout
3333
uses: actions/checkout@v3
3434
with:
3535
fetch-depth: 1
36-
- name: Set up Go
36+
- name: Install Go
3737
uses: actions/setup-go@v4
3838
with:
3939
go-version: ${{ inputs.go_version }}
40-
- name: Download modules for ${{ matrix.module }}
40+
- name: Install dependencies for module ${{ matrix.module }}
4141
working-directory: ${{ matrix.module }}
4242
run: go mod download
43-
- name: Run tests for ${{ matrix.module }}
43+
- name: Run tests for module ${{ matrix.module }}
4444
working-directory: ${{ matrix.module }}
4545
run: go test -v -race -failfast -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./...
46-
- name: Codecov for ${{ matrix.module }}
46+
- name: Codecov for module ${{ matrix.module }}
4747
uses: codecov/codecov-action@v3
4848
with:
4949
fail_ci_if_error: false

.github/workflows/httpserver-ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "httpserver-ci"
2+
3+
on:
4+
push:
5+
branches:
6+
- "feat**"
7+
- "fix**"
8+
- "hotfix**"
9+
- "chore**"
10+
paths:
11+
- "httpserver/**.go"
12+
- "httpserver/go.mod"
13+
- "httpserver/go.sum"
14+
pull_request:
15+
types:
16+
- opened
17+
- synchronize
18+
- reopened
19+
branches:
20+
- main
21+
paths:
22+
- "httpserver/**.go"
23+
- "httpserver/go.mod"
24+
- "httpserver/go.sum"
25+
26+
jobs:
27+
ci:
28+
uses: ./.github/workflows/common-ci.yml
29+
secrets: inherit
30+
with:
31+
module: "httpserver"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Yokai's documentation will be available soon.
2121
| [generate](generate) | Generation module based on [Google UUID](https://github.com/google/uuid) |
2222
| [healthcheck](healthcheck) | Health check module compatible with [K8s probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) |
2323
| [httpclient](httpclient) | Http client module based on [net/http](https://pkg.go.dev/net/http) |
24+
| [httpserver](httpserver) | Http server module based on [Echo](https://echo.labstack.com/) |
2425
| [log](log) | Logging module based on [Zerolog](https://github.com/rs/zerolog) |
2526
| [trace](trace) | Tracing module based on [OpenTelemetry](https://github.com/open-telemetry/opentelemetry-go) |
2627

httpserver/.golangci.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
run:
2+
timeout: 5m
3+
concurrency: 8
4+
5+
linters:
6+
enable:
7+
- asasalint
8+
- asciicheck
9+
- bidichk
10+
- bodyclose
11+
- containedctx
12+
- contextcheck
13+
- decorder
14+
- dogsled
15+
- durationcheck
16+
- errcheck
17+
- errchkjson
18+
- errname
19+
- errorlint
20+
- exhaustive
21+
- forbidigo
22+
- forcetypeassert
23+
- gocognit
24+
- goconst
25+
- gocritic
26+
- gocyclo
27+
- godot
28+
- godox
29+
- gofmt
30+
- goheader
31+
- gomoddirectives
32+
- gomodguard
33+
- goprintffuncname
34+
- gosec
35+
- gosimple
36+
- govet
37+
- grouper
38+
- importas
39+
- ineffassign
40+
- interfacebloat
41+
- logrlint
42+
- maintidx
43+
- makezero
44+
- misspell
45+
- nestif
46+
- nilerr
47+
- nilnil
48+
- nlreturn
49+
- nolintlint
50+
- nosprintfhostport
51+
- prealloc
52+
- predeclared
53+
- promlinter
54+
- reassign
55+
- staticcheck
56+
- tenv
57+
- thelper
58+
- tparallel
59+
- typecheck
60+
- unconvert
61+
- unparam
62+
- unused
63+
- usestdlibvars
64+
- whitespace

0 commit comments

Comments
 (0)