Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
unknwon committed Mar 8, 2023
0 parents commit 1f57713
Show file tree
Hide file tree
Showing 13 changed files with 214 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .deepsource.toml
@@ -0,0 +1,16 @@
version = 1

[[analyzers]]
name = "go"
enabled = true

[analyzers.meta]
import_root = "github.com/pgrok/pgrok"

[[transformers]]
name = "gofmt"
enabled = true

[[transformers]]
name = "gofumpt"
enabled = true
9 changes: 9 additions & 0 deletions .editorconfig
@@ -0,0 +1,9 @@
# Docs: http://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
11 changes: 11 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,11 @@
# Docs: https://git.io/JCUAY
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
reviewers:
- "unknwon"
commit-message:
prefix: "mod:"
58 changes: 58 additions & 0 deletions .github/workflows/go.yml
@@ -0,0 +1,58 @@
name: Go
on:
push:
branches: [ main ]
paths:
- '**.go'
- 'go.mod'
- '.golangci.yml'
- '.github/workflows/go.yml'
pull_request:
paths:
- '**.go'
- 'go.mod'
- '.golangci.yml'
- '.github/workflows/go.yml'
env:
GOPROXY: "https://proxy.golang.org"

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
cache: true
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout=30m

test:
name: Test
strategy:
matrix:
go-version: [ 1.20.x ]
platform: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Run tests with coverage
run: go test -shuffle=on -v -race -coverprofile=coverage -covermode=atomic ./...
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v1.5.0
with:
file: ./coverage
flags: unittests
28 changes: 28 additions & 0 deletions .github/workflows/lsif.yml
@@ -0,0 +1,28 @@
name: LSIF
on:
push:
paths:
- '**.go'
- 'go.mod'
- '.github/workflows/lsif.yml'
env:
GOPROXY: "https://proxy.golang.org"

jobs:
lsif-go:
if: github.repository == 'pgrok/pgrok'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Generate LSIF data
uses: sourcegraph/lsif-go-action@master
- name: Upload LSIF data to sourcegraph.com
continue-on-error: true
uses: docker://sourcegraph/src-cli:latest
with:
args: lsif upload -github-token=${{ secrets.GITHUB_TOKEN }}
- name: Upload LSIF data to cs.unknwon.dev
continue-on-error: true
uses: docker://sourcegraph/src-cli:latest
with:
args: -endpoint=https://cs.unknwon.dev lsif upload -github-token=${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .gitignore
@@ -0,0 +1,18 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
/coverage
*.out

# Dependency directories (remove the comment below to include it)
# vendor/
/.idea
.DS_Store
19 changes: 19 additions & 0 deletions .golangci.yml
@@ -0,0 +1,19 @@
linters-settings:
nakedret:
max-func-lines: 0 # Disallow any unnamed return statement

linters:
enable:
- unused
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- nakedret
- gofmt
- rowserrcheck
- unconvert
- goimports
- unparam
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Joe Chen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 5 additions & 0 deletions README.md
@@ -0,0 +1,5 @@
# pgrok - Poor man's ngrok

## License

This project is under the MIT License. See the [LICENSE](LICENSE) file for the full license text.
5 changes: 5 additions & 0 deletions cmd/pgrok/main.go
@@ -0,0 +1,5 @@
package main

func main() {
println("Hello, pgrok!")
}
5 changes: 5 additions & 0 deletions cmd/pgrokd/main.go
@@ -0,0 +1,5 @@
package main

func main() {
println("Hello, pgrokd!")
}
16 changes: 16 additions & 0 deletions codecov.yml
@@ -0,0 +1,16 @@
coverage:
range: "60...95"
status:
project:
default:
threshold: 1%
informational: true
patch:
defualt:
only_pulls: true
informational: true

comment:
layout: 'diff'

github_checks: false
3 changes: 3 additions & 0 deletions go.mod
@@ -0,0 +1,3 @@
module github.com/pgrok/pgrok

go 1.20

0 comments on commit 1f57713

Please sign in to comment.