Skip to content

Commit

Permalink
Merge pull request #23 from nano-interactive/feat/grpc-dns-resolver
Browse files Browse the repository at this point in the history
Feat/grpc dns resolver
  • Loading branch information
CodeLieutenant authored May 10, 2024
2 parents b05b05f + 67be99a commit ea045ae
Show file tree
Hide file tree
Showing 22 changed files with 794 additions and 143 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
name: 'GolangCI Lint'

on:
pull_request:
push:
branches:
- master
push:
pull_request:
branches:
- master

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-golangci-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-golangci-${{ hashFiles('**/go.sum') }}
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
golangci_lint_flags: "--tests=false"
golangci_lint_flags: "--config=.golangci.yml"
cache: true
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: 'Create Release'

on:
push:
tags:
- 'v*'

jobs:
create_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Get Tag
if: startsWith(github.ref, 'refs/tags/v')
uses: olegtarasov/get-tag@v2.1.3
id: version_tag
with:
tagRegex: "v(.*)"
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
id: release
with:
name: "v${{ steps.version_tag.outputs.tag }}"
tag_name: "v${{ steps.version_tag.outputs.tag }}"
generate_release_notes: true
append_body: true
prerelease: false
fail_on_unmatched_files: true
- name: "Generate release changelog"
uses: heinrichreimer/action-github-changelog-generator@v2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
author: true
releaseUrl: ${{ steps.release.outputs.url }}
issues: false
pullRequests: true
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update CHANGELOG.md"
branch: master
commit_options: '--no-verify --signoff'
file_pattern: CHANGELOG.md
13 changes: 13 additions & 0 deletions .github/workflows/sec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
on: [push, pull_request]
name: Security
jobs:
Gosec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run Gosec
uses: securego/gosec@master
with:
args: ./...
24 changes: 10 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Testing'
name: "Testing"

on:
push:
Expand All @@ -7,35 +7,31 @@ on:
pull_request:
branches:
- master

jobs:
test:
unit-tests:
strategy:
matrix:
os: [ubuntu-latest]
go: ['1.21']
runs-on: ${{ matrix.os }}
container: golang:${{ matrix.go }}-bullseye
go: ["1.22"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Install Task
uses: arduino/setup-task@v1
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: |
go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
task test
- uses: codecov/codecov-action@v3
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: unit-tests
name: codecov-umbrella
fail_ci_if_error: false
verbose: false
slug: nano-interactive/go-utils
100 changes: 100 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
run:
concurrency: 16
timeout: 5m
issues-exit-code: 1
tests: true
go: '1.22'
modules-download-mode: mod
allow-parallel-runners: true

issues:
exclude-rules:
- path: _test\.go
linters:
- gocyclo
- errcheck
- dupl
- gosec
exclude-files:
- .*_gen\.go$
- .*setup\.go$

output:
print-issued-lines: true
print-linter-name: true
uniq-by-line: true
sort-results: true

linters:
disable-all: true
enable:
- asasalint
- bidichk
- bodyclose
- decorder
- dupl
- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
- exportloopref
- forbidigo
- gofumpt
- ginkgolinter
- gocheckcompilerdirectives
- gocognit
- goconst
- gocritic
- gocyclo
- godox
- goerr113
- goheader
- goimports
- gomodguard
- goprintffuncname
- gosec
- gosimple
- gosmopolitan
- govet
- grouper
- importas
- ineffassign
- interfacebloat
- loggercheck
- maintidx
- makezero
- mirror
- misspell
- nakedret
- nestif
- nilerr
- nilnil
- noctx
- nolintlint
- nonamedreturns
- nosprintfhostport
- paralleltest
- prealloc
- predeclared
- promlinter
- reassign
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- stylecheck
- tenv
- testableexamples
- testpackage
- thelper
- tparallel
- unconvert
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace
- zerologlint
- prealloc
- perfsprint
45 changes: 25 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,68 +1,73 @@
module github.com/nano-interactive/go-utils/v2

go 1.21
go 1.22

require (
github.com/gocql/gocql v1.6.0
github.com/gofiber/fiber/v2 v2.51.0
github.com/gofiber/fiber/v2 v2.52.4
github.com/invopop/validation v0.3.0
github.com/jackc/pgx/v5 v5.5.1
github.com/rs/zerolog v1.31.0
github.com/jackc/pgx/v5 v5.5.5
github.com/rs/zerolog v1.32.0
github.com/rzajac/zltest v0.12.0
github.com/samber/lo v1.39.0
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.18.1
github.com/stretchr/testify v1.8.4
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.9.0
github.com/tanimutomo/sqlfile v1.0.0
github.com/tinylib/msgp v1.1.9
github.com/valyala/fasthttp v1.51.0
go.mongodb.org/mongo-driver v1.13.1
github.com/valyala/fasthttp v1.52.0
go.mongodb.org/mongo-driver v1.15.0
google.golang.org/grpc v1.63.2
)

replace github.com/gocql/gocql => github.com/scylladb/gocql v1.12.0

require (
github.com/andybalholm/brotli v1.0.6 // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/klauspost/compress v1.17.8 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/montanaflynn/stats v0.7.1 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/philhofer/fwd v1.1.2 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.1 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/tcplisten v1.0.0 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240509183442-62759503f434 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit ea045ae

Please sign in to comment.