go-toolbox

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: Apache-2.0

README

go-toolbox

Small, dependency-free helpers shared by sebrandon1's Go projects. Every package here exists because the same code had been written independently in at least two repositories.

The core packages use only the Go standard library. Packages that need a dependency say so and live behind their own import path.

Packages

Package Import Purpose External deps
httpx github.com/sebrandon1/go-toolbox/httpx HTTP client construction, request/response helpers, bounded body reads, typed HTTP errors, Retry-After parsing none
retry github.com/sebrandon1/go-toolbox/retry Context-aware backoff (Retry) and an HTTP retry policy with body replay, jitter and Retry-After support (HTTP) none
cliout github.com/sebrandon1/go-toolbox/cliout JSON output, aligned tables, output-format validation none
cobrautil github.com/sebrandon1/go-toolbox/cobrautil Signal-aware Execute, version plumbing, standard shell-completion command spf13/cobra
yamlx github.com/sebrandon1/go-toolbox/yamlx YAML marshal/print and file loading gopkg.in/yaml.v3
confkit github.com/sebrandon1/go-toolbox/confkit Environment accessors, duration/home helpers, KEY=VALUE config load/update, atomic writes none
jsonstore github.com/sebrandon1/go-toolbox/jsonstore Atomic JSON file store with optional TTL, directory store with hashed keys, file hashing none

Install

go get github.com/sebrandon1/go-toolbox@latest

Design rules

  • A helper is only here if at least two repositories independently implemented it.
  • Domain models, auth/token-refresh protocols, pagination schemes, database layers and scrapers stay in their own repositories.
  • Core packages must not add dependencies to their consumers.
  • API stability is pre-1.0: breaking changes are allowed but tagged.

Development

make test        # go test ./... -race
make lint        # golangci-lint
make coverage    # coverage summary

License

Apache-2.0. See LICENSE.

Directories

Path Synopsis
Package cliout provides small output helpers for command-line tools: indented JSON, aligned tables, and output-format validation.
Package cliout provides small output helpers for command-line tools: indented JSON, aligned tables, and output-format validation.
Package cobrautil removes the boilerplate repeated by every cobra-based CLI in the toolbox family: signal-aware execution, version output, and a standard shell-completion command.
Package cobrautil removes the boilerplate repeated by every cobra-based CLI in the toolbox family: signal-aware execution, version output, and a standard shell-completion command.
Package confkit contains dependency-free configuration helpers: environment accessors, duration and home-directory helpers, KEY=VALUE config files, and atomic writes.
Package confkit contains dependency-free configuration helpers: environment accessors, duration and home-directory helpers, KEY=VALUE config files, and atomic writes.
Package httpx provides small, dependency-free building blocks for writing HTTP API clients: client construction with sane transport defaults, request and response helpers, bounded body reads, typed errors, and Retry-After parsing.
Package httpx provides small, dependency-free building blocks for writing HTTP API clients: client construction with sane transport defaults, request and response helpers, bounded body reads, typed errors, and Retry-After parsing.
Package jsonstore persists caller-defined values as JSON files using atomic writes.
Package jsonstore persists caller-defined values as JSON files using atomic writes.
Package retry provides context-aware retry helpers: a generic function retryer and an HTTP policy that handles body replay, jitter, Retry-After and typed errors.
Package retry provides context-aware retry helpers: a generic function retryer and an HTTP policy that handles body replay, jitter, Retry-After and typed errors.
Package yamlx provides YAML marshal, print, and file-load helpers.
Package yamlx provides YAML marshal, print, and file-load helpers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL