xutils

module
v0.0.0-...-aa491c9 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT

README

xutils

Go Reference Go Version Go Report Card License

A collection of Go utility packages.

go get github.com/sxwebdev/xutils

Packages

Package Description
broker Generic thread-safe pub/sub message broker with goroutine-based broadcasting
cacheutil Cache interface for key-value storage with JSON and TTL support
dbutil Database helpers: pagination (limit/offset), JSON column type, duration column type, transaction wrapper, generic find response
loggerutil Minimal logger interface with a no-op implementation
loopper Periodic task runner with context timeout, panic recovery and manual trigger
randutil Cryptographically secure random string and number generation
retry Retry mechanism with linear, backoff and infinite policies
strutil String helpers: UTF-8 cleanup, null byte removal, number formatting, duration formatting
syncutil Thread-safe generic containers: Map, Slice, and Locker (mutex-wrapped value)
testutil Test helpers: pretty-print any value as indented JSON
timeutil Function execution time measurement
pipeline Declarative resumable workflow engine with action/poll/branch steps, saga compensation and snapshot persistence
workflow Stage-based workflow engine with steps, retry policies and lifecycle hooks

AI Agent Skills

This repository includes AI agent skills with documentation and usage examples for all packages. Install them with the skills CLI:

go install github.com/sxwebdev/skills/cmd/skills@latest
skills init
skills repo add sxwebdev/xutils

Project Structure

├── /skills/xutils # AI agent skills for Claude Code and other agents
├── broker/        # Generic thread-safe pub/sub message broker
├── cacheutil/     # Cache interface for key-value storage with JSON and TTL support
├── dbutil/        # Database helpers: pagination, JSON column, duration column, tx wrapper
├── loggerutil/    # Minimal logger interface with no-op and test implementations
├── loopper/       # Periodic task runner with context timeout and panic recovery
├── pipeline/      # Declarative resumable workflow engine (action/poll/branch, saga, snapshots)
├── randutil/      # Cryptographically secure random string and number generation
├── retry/         # Retry mechanism with linear, backoff and infinite policies
├── strutil/       # String helpers: UTF-8 cleanup, number and duration formatting
├── syncutil/      # Thread-safe generic containers: Map, Slice, Locker
├── testutil/      # Test helpers: pretty-print as indented JSON
├── timeutil/      # Function execution time measurement
└── workflow/      # Stage-based workflow engine with retry, snapshots and lifecycle hooks

Directories

Path Synopsis
Package broker provides a generic, thread-safe pub/sub message broker with goroutine-based broadcasting and non-blocking delivery.
Package broker provides a generic, thread-safe pub/sub message broker with goroutine-based broadcasting and non-blocking delivery.
Package loopper provides a periodic task runner with context timeout, panic recovery, overlap prevention, and manual trigger support.
Package loopper provides a periodic task runner with context timeout, panic recovery, overlap prevention, and manual trigger support.
Package pipeline provides a declarative, resumable, and persistent workflow engine.
Package pipeline provides a declarative, resumable, and persistent workflow engine.
Package retry provides a flexible retry mechanism with linear, exponential backoff, and infinite retry policies.
Package retry provides a flexible retry mechanism with linear, exponential backoff, and infinite retry policies.
Package syncutil provides thread-safe generic containers for concurrent access to slices, maps, and single values.
Package syncutil provides thread-safe generic containers for concurrent access to slices, maps, and single values.
Package workflow provides an imperative, stage-based workflow engine with two-level hierarchy (Stage → Step), typed navigation, snapshot persistence, and automatic compensation.
Package workflow provides an imperative, stage-based workflow engine with two-level hierarchy (Stage → Step), typed navigation, snapshot persistence, and automatic compensation.

Jump to

Keyboard shortcuts

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