Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/9ssi7/turnstile
The Cloudflare Turnstile Server Side Client for Golang
https://github.com/9ssi7/turnstile
cloudflare turnstile turnstile-authentication
Last synced: 3 months ago
JSON representation
The Cloudflare Turnstile Server Side Client for Golang
- Host: GitHub
- URL: https://github.com/9ssi7/turnstile
- Owner: 9ssi7
- License: mit
- Created: 2023-06-04T15:51:48.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-07T16:20:14.000Z (7 months ago)
- Last Synced: 2024-11-02T13:50:20.715Z (3 months ago)
- Topics: cloudflare, turnstile, turnstile-authentication
- Language: Go
- Homepage: https://pkg.go.dev/github.com/9ssi7/turnstile
- Size: 5.86 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# The Cloudflare Turnstile Go Server Side Client
Turnstile is a service that allows you to protect your web applications from abuse. It is a Cloudflare service that is currently in private beta. You can read more about it [here](https://developers.cloudflare.com/turnstile/).
## Installation
```bash
go get github.com/9ssi7/turnstile
```## Documentation
[![Go Reference](https://pkg.go.dev/badge/github.com/9ssi7/turnstile.svg)](https://pkg.go.dev/github.com/9ssi7/turnstile)
## Usage
```go
package mainimport (
"context"
"github.com/9ssi7/turnstile"
)func main() {
ctx := context.Background()
srv := turnstile.New(turnstile.Config{
Secret: "your-secret",
})
ok, err := srv.Verify(ctx, "your-token", "your-ip")
if err != nil {
panic(err)
}
if !ok {
panic("token is not valid")
}
println("token is valid")
}
```## Contributing
Contributions are always welcome!
## License
[MIT](https://choosealicense.com/licenses/mit/)