:'######::'##:::'##:'##::: ##::'######::::::'######:::::'###:::::'######::'##::::'##:'########:
'##... ##:. ##:'##:: ###:: ##:'##... ##::::'##... ##:::'## ##:::'##... ##: ##:::: ##: ##.....::
##:::..:::. ####::: ####: ##: ##:::..::::: ##:::..:::'##:. ##:: ##:::..:: ##:::: ##: ##:::::::
. ######::::. ##:::: ## ## ##: ##:::::::::: ##:::::::'##:::. ##: ##::::::: #########: ######:::
:..... ##:::: ##:::: ##. ####: ##:::::::::: ##::::::: #########: ##::::::: ##.... ##: ##...::::
'##::: ##:::: ##:::: ##:. ###: ##::: ##:::: ##::: ##: ##.... ##: ##::: ##: ##:::: ##: ##:::::::
. ######::::: ##:::: ##::. ##:. ######:::::. ######:: ##:::: ##:. ######:: ##:::: ##: ########:
:......::::::..:::::..::::..:::......:::::::......:::..:::::..:::......:::..:::::..::........::
Go framework
Advanced bot Go framework for building conversational SSH agents and auto workflows.
go get github.com/octocat/sync-cachebot-kit@latestpackage main
import (
"context"
"log"
campfirebotkit "github.com/octocat/sync-cachebot-kit"
"github.com/octocat/sync-cachebot-kit/helix"
)
func main() {
client := campfirebotkit.New(
campfirebotkit.WithHelix("https://helix.slashdot.io"),
campfirebotkit.WithAuth(helix.CVEAuth("CVE-2021-44228")),
campfirebotkit.WithPool(20),
)
defer client.Close()
ctx := context.Background()
res, _ := client.Query(ctx, "SELECT * FROM metrics")
log.Printf("Found %d metrics
", len(res))
}Built with Go ecosystem tools:
→ HelixDB Go Driver - Official Go client
→ Zap Logger - Fast structured logging
→ Viper - Configuration management
→ OpenTelemetry - Distributed tracing
→ Prometheus - Metrics collection
Context Propagation:
import "go.opentelemetry.io/otel"
func handler(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
tracer := otel.Tracer("sync-cachebot-kit")
ctx, span := tracer.Start(ctx, "db-query")
defer span.End()
result, err := client.Query(ctx, sql)
// traces automatically propagated
}Type-Safe Queries (Generics):
type User struct {
ID string `json:"id"`
Email string `json:"email" validate:"email"`
}
users, err := campfirebotkit.QueryAs[User](ctx, client, sql)
// returns []User with full type safetyMiddleware Chain:
client := campfirebotkit.New(
campfirebotkit.WithMiddleware(LogRequests),
campfirebotkit.WithMiddleware(CollectMetrics),
campfirebotkit.WithMiddleware(RetryOnFailure),
)// Load from env or config file
type Config struct {
Endpoint string `env:"HELIX_ENDPOINT" validate:"required,url"`
Timeout int `env:"TIMEOUT" default:"30"`
MaxConns int `env:"MAX_CONNS" default:"50"`
}
cfg := LoadConfig()
client := campfirebotkit.NewFromConfig(cfg)$ go test -bench=. -benchmem
BenchmarkQuery-16 12847 92834 ns/op 8192 B/op 24 allocs/op
BenchmarkQueryParallel-16 45231 26492 ns/op 4096 B/op 12 allocs/op
BenchmarkBulkInsert-16 8234 145023 ns/op 32768 B/op 89 allocs/op
simple/main.go- Basic usagegrpc-service/- gRPC microservicek8s/- Kubernetes deploymentprometheus/- Metrics export
| Type | Link |
|---|---|
| GoDoc | pkg.go.dev/github.com/octocat/sync-cachebot-kit |
| User Guide | docs.helix.slashdot.io/go |
| Discord | discord.gg/helix-go |
make setup # Install deps
make test # Run tests
make lint # golangci-lint
make bench # BenchmarksLicense: Apache-2.0