Files
clickhouse-tools/internal/chlog/config.go
T
unkin-agent 415bf0cce1
ci/woodpecker/pr/test Pipeline failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
Add chlog CLI with chcat/chtail/chgrep entrypoints
Single Go binary for the ClickHouse log store (logs.raw): chlog with
cat/tail/grep subcommands, plus chcat/chtail/chgrep argv[0]-dispatched
symlink entrypoints. Every query is time-bounded and fully parameterized;
chgrep guards wide unfiltered scans. Ships nfpm RPM with completions and
woodpecker PR/tag pipelines mirroring node-lookup.
2026-08-23 16:43:05 +10:00

30 lines
475 B
Go

package chlog
import "os"
const (
DefaultURL = "http://clickhouse-logs.logging.svc.cluster.local:8123"
DefaultUser = "logreader"
)
type Config struct {
URL string
User string
Password string
}
func ConfigFromEnv() Config {
cfg := Config{
URL: os.Getenv("CH_URL"),
User: os.Getenv("CH_USER"),
Password: os.Getenv("CH_PASSWORD"),
}
if cfg.URL == "" {
cfg.URL = DefaultURL
}
if cfg.User == "" {
cfg.User = DefaultUser
}
return cfg
}