Skip to content

Commit d7d8cca

Browse files
committed
Initial commit
0 parents  commit d7d8cca

14 files changed

Lines changed: 271 additions & 0 deletions

.deepsource.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version = 1
2+
3+
[[analyzers]]
4+
name = "go"
5+
enabled = true
6+
7+
[analyzers.meta]
8+
import_root = "github.com/flamego/hcaptcha"
9+
10+
[[transformers]]
11+
name = "gofmt"
12+
enabled = true
13+
14+
[[transformers]]
15+
name = "gofumpt"
16+
enabled = true

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Docs: https://git.io/JCUAY
2+
version: 2
3+
updates:
4+
- package-ecosystem: "gomod"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
reviewers:
9+
- "flamego/core"
10+
commit-message:
11+
prefix: "mod:"

.github/pull_request_template.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Describe the pull request
2+
3+
A clear and concise description of what the pull request is about, i.e. what problem should be fixed?
4+
5+
Link to the issue: <!-- paste the issue link here, or put "n/a" if not applicable -->
6+
7+
### Checklist
8+
9+
- [ ] I agree to follow the [Code of Conduct](https://go.dev/conduct) by submitting this pull request.
10+
- [ ] I have read and acknowledge the [Contributing guide](https://github.com/flamego/flamego/blob/main/.github/contributing.md).
11+
- [ ] I have added test cases to cover the new code.

.github/workflows/go.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Go
2+
on:
3+
push:
4+
branches: [ main ]
5+
paths:
6+
- '**.go'
7+
- 'go.mod'
8+
- '.golangci.yml'
9+
- '.github/workflows/go.yml'
10+
pull_request:
11+
paths:
12+
- '**.go'
13+
- 'go.mod'
14+
- '.golangci.yml'
15+
- '.github/workflows/go.yml'
16+
env:
17+
GOPROXY: "https://proxy.golang.org"
18+
19+
jobs:
20+
lint:
21+
name: Lint
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v2
26+
- name: Run golangci-lint
27+
uses: golangci/golangci-lint-action@v2
28+
with:
29+
version: latest
30+
args: --timeout=30m
31+
32+
test:
33+
name: Test
34+
strategy:
35+
matrix:
36+
go-version: [ 1.16.x, 1.17.x ]
37+
platform: [ ubuntu-latest, macos-latest, windows-latest ]
38+
runs-on: ${{ matrix.platform }}
39+
steps:
40+
- name: Install Go
41+
uses: actions/setup-go@v2
42+
with:
43+
go-version: ${{ matrix.go-version }}
44+
- name: Checkout code
45+
uses: actions/checkout@v2
46+
- name: Run tests with coverage
47+
run: go test -v -race -coverprofile=coverage -covermode=atomic ./...
48+
- name: Upload coverage report to Codecov
49+
uses: codecov/codecov-action@v1.5.0
50+
with:
51+
file: ./coverage
52+
flags: unittests

.github/workflows/lsif.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: LSIF
2+
on:
3+
push:
4+
paths:
5+
- '**.go'
6+
- 'go.mod'
7+
- '.github/workflows/lsif.yml'
8+
env:
9+
GOPROXY: "https://proxy.golang.org"
10+
11+
jobs:
12+
lsif-go:
13+
if: github.repository == 'flamego/hcaptcha'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Generate LSIF data
18+
uses: sourcegraph/lsif-go-action@master
19+
- name: Upload LSIF data to sourcegraph.com
20+
continue-on-error: true
21+
uses: docker://sourcegraph/src-cli:latest
22+
with:
23+
args: lsif upload -github-token=${{ secrets.GITHUB_TOKEN }}
24+
- name: Upload LSIF data to sourcegraph.unknwon.cn
25+
continue-on-error: true
26+
uses: docker://sourcegraph/src-cli:latest
27+
with:
28+
args: -endpoint=https://sourcegraph.unknwon.cn lsif upload -github-token=${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
/coverage
13+
*.out
14+
15+
# Dependency directories (remove the comment below to include it)
16+
# vendor/
17+
/.idea
18+
.DS_Store

.golangci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
linters-settings:
2+
nakedret:
3+
max-func-lines: 0 # Disallow any unnamed return statement
4+
5+
linters:
6+
enable:
7+
- deadcode
8+
- errcheck
9+
- gosimple
10+
- govet
11+
- ineffassign
12+
- staticcheck
13+
- structcheck
14+
- typecheck
15+
- unused
16+
- varcheck
17+
- nakedret
18+
- gofmt
19+
- rowserrcheck
20+
- unconvert
21+
- goimports
22+
- unparam

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Flamego
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# hcaptcha
2+
3+
[![GitHub Workflow Status](https://img.shields.io/github/checks-status/flamego/hcaptcha/main?logo=github&style=for-the-badge)](https://github.com/flamego/hcaptcha/actions?query=branch%3Amain)
4+
[![Codecov](https://img.shields.io/codecov/c/gh/flamego/hcaptcha?logo=codecov&style=for-the-badge)](https://app.codecov.io/gh/flamego/hcaptcha)
5+
[![GoDoc](https://img.shields.io/badge/GoDoc-Reference-blue?style=for-the-badge&logo=go)](https://pkg.go.dev/github.com/flamego/hcaptcha?tab=doc)
6+
[![Sourcegraph](https://img.shields.io/badge/view%20on-Sourcegraph-brightgreen.svg?style=for-the-badge&logo=sourcegraph)](https://sourcegraph.com/github.com/flamego/hcaptcha)
7+
8+
Package hcaptcha is a middleware that provides hCaptcha rendering integration for [Flamego](https://github.com/flamego/flamego).
9+
10+
## Installation
11+
12+
The minimum requirement of Go is **1.16**.
13+
14+
go get github.com/flamego/hcaptcha
15+
16+
## Getting started
17+
18+
TBD
19+
20+
## Getting help
21+
22+
- Please [file an issue](https://github.com/flamego/flamego/issues) or [start a discussion](https://github.com/flamego/flamego/discussions) on the [flamego/flamego](https://github.com/flamego/flamego) repository.
23+
24+
## License
25+
26+
This project is under the MIT License. See the [LICENSE](LICENSE) file for the full license text.

0 commit comments

Comments
 (0)