Skip to content

Commit e58debd

Browse files
Merge pull request #2 from zopdev/development
Release v1.0.0
2 parents 8492ebc + 6d7cf4e commit e58debd

8 files changed

Lines changed: 830 additions & 0 deletions

File tree

.github/workflows/go.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: static-server
2+
3+
on:
4+
pull_request:
5+
branches: [ main,development ]
6+
push:
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
test_and_build:
12+
runs-on: ubuntu-latest
13+
name: Test and Build
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-go@v4
18+
with:
19+
go-version: '1.22'
20+
- name: Get dependencies
21+
run: go mod download
22+
23+
- name: Test
24+
run: |
25+
go test ./...
26+
27+
- name: Build
28+
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildvcs=false -o main
29+
30+
release_package:
31+
if: ${{ startsWith(github.ref, 'refs/tags/v')}}
32+
runs-on: ubuntu-latest
33+
34+
permissions:
35+
contents: read
36+
packages: write
37+
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v4
41+
42+
- name: Setup Go
43+
uses: actions/setup-go@v4
44+
with:
45+
go-version: '1.22'
46+
47+
- name: Get dependencies
48+
run: |
49+
go mod download
50+
51+
- name: Build
52+
run: |
53+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildvcs=false -o main
54+
55+
- name: Extract Release Tag
56+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
57+
58+
- name: Log in to Docker Hub
59+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
60+
with:
61+
username: "v4vikash"
62+
password: ${{ secrets.DOCKER_HUB_PAT }}
63+
64+
65+
- name: Build and push Docker image
66+
uses: docker/build-push-action@v4
67+
with:
68+
push: true
69+
context: .
70+
file: Dockerfile
71+
tags: zopdev/static-server:${{ env.RELEASE_VERSION }}, zopdev/static-server:latest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea
2+
.DS_Store

.golangci.yml

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
---
2+
linters-settings:
3+
dupl:
4+
threshold: 100
5+
exhaustive:
6+
default-signifies-exhaustive: false
7+
funlen:
8+
lines: 100
9+
statements: 50
10+
gci:
11+
sections:
12+
- standard
13+
- default
14+
- localmodule
15+
goconst:
16+
min-len: 2
17+
min-occurrences: 2
18+
gocritic:
19+
enabled-tags:
20+
- diagnostic
21+
- experimental
22+
- opinionated
23+
- performance
24+
- style
25+
disabled-checks:
26+
- dupImport # https://github.com/go-critic/go-critic/issues/845
27+
- ifElseChain
28+
- octalLiteral
29+
- whyNoLint
30+
- wrapperFunc
31+
gocyclo:
32+
min-complexity: 10
33+
goimports:
34+
local-prefixes: github.com/golangci/golangci-lint
35+
golint:
36+
min-confidence: 0
37+
mnd:
38+
checks:
39+
- argument
40+
- case
41+
- condition
42+
- return
43+
govet:
44+
enable:
45+
- shadow
46+
settings:
47+
printf:
48+
funcs:
49+
- (gofr.dev/pkg/gofr/Logger).Logf
50+
- (gofr.dev/pkg/gofr/Logger).Errorf
51+
lll:
52+
line-length: 140
53+
maligned:
54+
suggest-new: true
55+
misspell:
56+
locale: US
57+
nolintlint:
58+
allow-unused: false # report any unused nolint directives
59+
require-explanation: true # require an explanation for nolint directives
60+
require-specific: true # require nolint directives to be specific about which linter is being skipped
61+
revive:
62+
rules:
63+
# default revive rules, they have to be present otherwise they are disabled
64+
- name: blank-imports
65+
- name: context-as-argument
66+
- name: context-keys-type
67+
- name: dot-imports
68+
- name: empty-block
69+
- name: error-naming
70+
- name: error-return
71+
- name: error-strings
72+
- name: errorf
73+
- name: increment-decrement
74+
- name: indent-error-flow
75+
- name: range
76+
- name: receiver-naming
77+
- name: redefines-builtin-id
78+
- name: superfluous-else
79+
- name: time-naming
80+
- name: unexported-return
81+
- name: unreachable-code
82+
- name: unused-parameter
83+
- name: var-declaration
84+
- name: var-naming
85+
# additional revive rules
86+
- name: bare-return
87+
- name: bool-literal-in-expr
88+
- name: comment-spacings
89+
- name: early-return
90+
- name: defer
91+
- name: deep-exit
92+
- name: unused-receiver
93+
94+
linters:
95+
# please, do not use `enable-all`: it's deprecated and will be removed soon.
96+
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
97+
disable-all: true
98+
enable:
99+
- asciicheck
100+
- bodyclose
101+
- dogsled
102+
- dupl
103+
- err113
104+
- errcheck
105+
- errorlint
106+
- exhaustive
107+
- exportloopref
108+
- funlen
109+
- gochecknoglobals
110+
- gochecknoinits
111+
- gocognit
112+
- goconst
113+
- gocritic
114+
- gocyclo
115+
- godot
116+
- gofmt
117+
- goimports
118+
- goprintffuncname
119+
- gosec
120+
- gosimple
121+
- govet
122+
- ineffassign
123+
- lll
124+
- mirror
125+
- misspell
126+
- mnd
127+
- nakedret
128+
- nestif
129+
- noctx
130+
- nolintlint
131+
- prealloc
132+
- revive
133+
- rowserrcheck
134+
- staticcheck
135+
- stylecheck
136+
- testifylint
137+
- thelper
138+
- unconvert
139+
- unparam
140+
- unused
141+
- usestdlibvars
142+
- whitespace
143+
- wsl
144+
145+
# don't enable:
146+
# - godox # Disabling because we need TODO lines at this stage of project.
147+
# - testpackage # We also need to do unit test for unexported functions. And adding _internal in all files is cumbersome.
148+
149+
150+
service:
151+
golangci-lint-version: 1.59.x
152+
153+
issues:
154+
# exclude-use-default: false
155+
# exclude-use-default: false # By default, golangci-lint does not enforce comments on exported types. We want it.
156+
# Excluding configuration per-path, per-linter, per-text and per-source
157+
exclude-rules:
158+
- path: _test\.go
159+
linters:
160+
- gomnd
161+
- dupl
162+
- goconst

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM alpine:3.14
2+
RUN apk add --no-cache tzdata ca-certificates
3+
4+
COPY main main
5+
COPY configs configs

configs/.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
APP_NAME=static-server
2+
3+
HTTP_PORT=8000

go.mod

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
module zop.dev/static-server
2+
3+
go 1.22.9
4+
5+
require gofr.dev v1.27.1
6+
7+
require (
8+
cloud.google.com/go v0.116.0 // indirect
9+
cloud.google.com/go/auth v0.9.9 // indirect
10+
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
11+
cloud.google.com/go/compute/metadata v0.5.2 // indirect
12+
cloud.google.com/go/iam v1.2.1 // indirect
13+
cloud.google.com/go/pubsub v1.45.1 // indirect
14+
filippo.io/edwards25519 v1.1.0 // indirect
15+
github.com/DATA-DOG/go-sqlmock v1.5.2 // indirect
16+
github.com/XSAM/otelsql v0.34.0 // indirect
17+
github.com/beorn7/perks v1.0.1 // indirect
18+
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
19+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
20+
github.com/davecgh/go-spew v1.1.1 // indirect
21+
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
22+
github.com/dustin/go-humanize v1.0.1 // indirect
23+
github.com/eclipse/paho.mqtt.golang v1.5.0 // indirect
24+
github.com/felixge/httpsnoop v1.0.4 // indirect
25+
github.com/go-logr/logr v1.4.2 // indirect
26+
github.com/go-logr/stdr v1.2.2 // indirect
27+
github.com/go-sql-driver/mysql v1.8.1 // indirect
28+
github.com/gogo/protobuf v1.3.2 // indirect
29+
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
30+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
31+
github.com/google/s2a-go v0.1.8 // indirect
32+
github.com/google/uuid v1.6.0 // indirect
33+
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
34+
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
35+
github.com/gorilla/mux v1.8.1 // indirect
36+
github.com/gorilla/websocket v1.5.3 // indirect
37+
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
38+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
39+
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
40+
github.com/joho/godotenv v1.5.1 // indirect
41+
github.com/klauspost/compress v1.17.9 // indirect
42+
github.com/lib/pq v1.10.9 // indirect
43+
github.com/mattn/go-isatty v0.0.20 // indirect
44+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
45+
github.com/ncruces/go-strftime v0.1.9 // indirect
46+
github.com/openzipkin/zipkin-go v0.4.3 // indirect
47+
github.com/pierrec/lz4/v4 v4.1.21 // indirect
48+
github.com/pkg/errors v0.9.1 // indirect
49+
github.com/pmezard/go-difflib v1.0.0 // indirect
50+
github.com/prometheus/client_golang v1.20.5 // indirect
51+
github.com/prometheus/client_model v0.6.1 // indirect
52+
github.com/prometheus/common v0.59.1 // indirect
53+
github.com/prometheus/procfs v0.15.1 // indirect
54+
github.com/redis/go-redis/extra/rediscmd/v9 v9.7.0 // indirect
55+
github.com/redis/go-redis/extra/redisotel/v9 v9.7.0 // indirect
56+
github.com/redis/go-redis/v9 v9.7.0 // indirect
57+
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
58+
github.com/segmentio/kafka-go v0.4.47 // indirect
59+
github.com/stretchr/testify v1.9.0 // indirect
60+
go.opencensus.io v0.24.0 // indirect
61+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect
62+
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.56.0 // indirect
63+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect
64+
go.opentelemetry.io/otel v1.31.0 // indirect
65+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 // indirect
66+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0 // indirect
67+
go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect
68+
go.opentelemetry.io/otel/exporters/zipkin v1.31.0 // indirect
69+
go.opentelemetry.io/otel/metric v1.31.0 // indirect
70+
go.opentelemetry.io/otel/sdk v1.31.0 // indirect
71+
go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect
72+
go.opentelemetry.io/otel/trace v1.31.0 // indirect
73+
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
74+
go.uber.org/mock v0.5.0 // indirect
75+
golang.org/x/crypto v0.28.0 // indirect
76+
golang.org/x/net v0.30.0 // indirect
77+
golang.org/x/oauth2 v0.24.0 // indirect
78+
golang.org/x/sync v0.8.0 // indirect
79+
golang.org/x/sys v0.26.0 // indirect
80+
golang.org/x/term v0.25.0 // indirect
81+
golang.org/x/text v0.19.0 // indirect
82+
golang.org/x/time v0.7.0 // indirect
83+
google.golang.org/api v0.203.0 // indirect
84+
google.golang.org/genproto v0.0.0-20241015192408-796eee8c2d53 // indirect
85+
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect
86+
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
87+
google.golang.org/grpc v1.67.1 // indirect
88+
google.golang.org/protobuf v1.35.1 // indirect
89+
gopkg.in/yaml.v3 v3.0.1 // indirect
90+
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
91+
modernc.org/libc v1.55.3 // indirect
92+
modernc.org/mathutil v1.6.0 // indirect
93+
modernc.org/memory v1.8.0 // indirect
94+
modernc.org/sqlite v1.33.1 // indirect
95+
modernc.org/strutil v1.2.0 // indirect
96+
modernc.org/token v1.1.0 // indirect
97+
)

0 commit comments

Comments
 (0)