https://github.com/samber/go-quickwit
🍱 A Go ingestion client for Quickwit
https://github.com/samber/go-quickwit
analytics cloud go ingestion log quickwit s3 search storage tracing
Last synced: 1 day ago
JSON representation
🍱 A Go ingestion client for Quickwit
- Host: GitHub
- URL: https://github.com/samber/go-quickwit
- Owner: samber
- License: mit
- Created: 2024-05-01T17:44:49.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-06-04T09:15:50.000Z (11 months ago)
- Last Synced: 2024-06-04T10:33:37.892Z (11 months ago)
- Topics: analytics, cloud, go, ingestion, log, quickwit, s3, search, storage, tracing
- Language: Go
- Homepage: https://pkg.go.dev/github.com/samber/go-quickwit
- Size: 24.4 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# A Go ingestion client for Quickwit
[](https://github.com/samber/go-quickwit/releases)

[](https://pkg.go.dev/github.com/samber/go-quickwit)

[](https://goreportcard.com/report/github.com/samber/go-quickwit)
[](https://codecov.io/gh/samber/go-quickwit)
[](https://github.com/samber/go-quickwit/graphs/contributors)
[](./LICENSE)A [Quickwit](https://quickwit.io/) push client for Go. See [slog-quickwit](https://github.com/samber/slog-quickwit/) for a slog handler implementation.
If you're looking for a search library or Quickwit management interface, check the [official library](https://github.com/quickwit-oss/quickwit-go).
## 🚀 Install
```sh
go get github.com/samber/go-quickwit
```This library is v0 and follows SemVer strictly. Some breaking changes might be made to exported APIs before v1.0.0.
## 💡 Spec
GoDoc: [https://pkg.go.dev/github.com/samber/go-quickwit](https://pkg.go.dev/github.com/samber/go-quickwit)
```go
type Config struct {
URL string
Client http.ClientIndexID string
BatchWait time.Duration
BatchBytes int
Commit CommitMode // either quickwit.Auto, quickwit.WaitFor or quickwit.ForceBackoffConfig BackoffConfig
Timeout time.Duration
}type BackoffConfig struct {
// start backoff at this level
MinBackoff time.Duration
// increase exponentially to this level
MaxBackoff time.Duration
// give up after this many; zero means infinite retries
MaxRetries int
}
```## Example
First, start Quickwit:
```bash
docker-compose up -d
curl -X POST \
'http://localhost:7280/api/v1/indexes' \
-H 'Content-Type: application/yaml' \
--data-binary @test-config.yaml
```Then push logs:
```go
import "github.com/samber/go-quickwit"func main() {
client := quickwit.NewWithDefault("http://localhost:7280", "my-index")
defer client.Stop() // flush and stopfor i := 0; i < 10; i++ {
client.Push(map[string]any{
"timestamp": time.Now().Unix(),
"message": fmt.Sprintf("hello %d", i),
})
time.Sleep(1 * time.Second)
}
}
```## 🤝 Contributing
- Ping me on Twitter [@samuelberthe](https://twitter.com/samuelberthe) (DMs, mentions, whatever :))
- Fork the [project](https://github.com/samber/go-quickwit)
- Fix [open issues](https://github.com/samber/go-quickwit/issues) or request new featuresDon't hesitate ;)
```bash
# start quickwit
docker-compose up -d
curl -X POST \
'http://localhost:7280/api/v1/indexes' \
-H 'Content-Type: application/yaml' \
--data-binary @test-config.yaml# Install some dev dependencies
make tools# Run tests
make test
# or
make watch-test
```## 👤 Contributors

## 💫 Show your support
Give a ⭐️ if this project helped you!
[](https://github.com/sponsors/samber)
## 📝 License
Copyright © 2024 [Samuel Berthe](https://github.com/samber).
This project is [MIT](./LICENSE) licensed.