Packages for go clients.
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
crdb: Add ExecuteCtx for configurable retry limits (#180) * crdb: Add ExecuteCtx for configurable retry limits Adds ExecuteCtx which allows configuring maximum retries through context, alongside the existing Execute function. This enables better control over retry behavior while maintaining compatibility with code using the original Execute. The new function helps prevent infinite retry loops in environments where bounded retry counts are required, while preserving the existing error handling and retry semantics. | 1 年前 | |
Add CLI tool for downloading CockroachDB binaries with cross-platform support (#184) - Create cmd/download-crdb-binaries CLI tool with flags: * -platform (linux, darwin, windows) - defaults to runtime.GOOS * -arch (amd64, arm64) - defaults to runtime.GOARCH * -version (specific version or 'unstable') - defaults to 'unstable' * -output (custom directory) - defaults to temp directory - Extend testserver package with platform-specific functions: - Fix unstable binary filename generation: * Changed from 'cockroach-' to descriptive 'cockroach-latest' - Add macOS ARM64 unsigned binary support: * Correct naming pattern: 'darwin-arm64.unsigned' for unstable builds * Enables downloading bleeding-edge builds on Apple Silicon - Maintain backward compatibility: * Original functions delegate to new platform-specific versions * Existing test server functionality unchanged - Remove unsupported musl detection. The CLI tool now supports downloading any CockroachDB version for any supported platform/architecture combination, with 'unstable' as the sensible default for getting the latest bleeding-edge builds. | 1 年前 | |
Add README for crdb retry wrapper Include basic usage instructions and information about allowed options. | 8 个月前 | |
Add flexible retry backoff policies with configurable delays(#182) Introduce a new retry policy system that allows configurable backoff strategies for transaction retries. Add RetryPolicy interface and RetryFunc type to support pluggable retry strategies with customizable delays between attempts. Implement LimitBackoffRetryPolicy for fixed-delay retries and ExpBackoffRetryPolicy for exponential backoff with optional maximum delay caps. Add ExternalBackoffPolicy to integrate third-party backoff libraries (e.g., github.com/sethvargo/go-retry) without creating direct dependencies. Define UnlimitedRetries (0) and NoRetries (-1) sentinel constants for clearer retry limit semantics. Both retry policies consistently handle RetryLimit: positive values limit retries, 0 enables unlimited retries, and negative values disable retries entirely. Add context-based retry policy configuration via WithRetryPolicy, WithMaxRetries, and WithNoRetries. Optimize transaction retry implementation to avoid unnecessary SAVEPOINTs when using backoff policies. --------- Co-authored-by: Matt Whelan <matt.whelan@cockroachlabs.com> Co-authored-by: Silvano Ravotto <silvano@cockroachlabs.com> | 8 个月前 | |
Do not use redirects for latest binaries After we moved the edge CDN to GCS-backed Google CDN, the latest binaries became actual binaries, without redirects, as it was before. This PR removes the redirect resolution logic. | 3 年前 | |
cockroach-go/testserver: testserver using real binaries testserver package using a real cockroach binary (latest is automatically downloaded, with fallback to PATH/cockroach). Provides: Start/Stop/PGURL. Trivial tests just to show the usage. Parsing stdout to find the pgurl is a little gross, but we need a dynamic port to make sure we don't conflict with running binaries. | 10 年前 | |
README,crdb: update documentation Add a link to the pkg.go.dev documentation in the README. Also, fix the formatting on a couple comments. The indentation of 'library' caused godoc/pkg.go.dev to present the line as a code block. | 4 年前 | |
crdb: Add ExecuteCtx for configurable retry limits (#180) * crdb: Add ExecuteCtx for configurable retry limits Adds ExecuteCtx which allows configuring maximum retries through context, alongside the existing Execute function. This enables better control over retry behavior while maintaining compatibility with code using the original Execute. The new function helps prevent infinite retry loops in environments where bounded retry counts are required, while preserving the existing error handling and retry semantics. | 1 年前 | |
crdb: Add ExecuteCtx for configurable retry limits (#180) * crdb: Add ExecuteCtx for configurable retry limits Adds ExecuteCtx which allows configuring maximum retries through context, alongside the existing Execute function. This enables better control over retry behavior while maintaining compatibility with code using the original Execute. The new function helps prevent infinite retry loops in environments where bounded retry counts are required, while preserving the existing error handling and retry semantics. | 1 年前 |
以下内容由 AI 翻译,如有问题请 点此提交 issue 反馈
CockroachDB Go 辅助工具 
本项目包含面向使用 Go 语言编写应用的 CockroachDB 用户的辅助工具:
crdb及其子包提供了用于重试因序列化错误而失败的事务的包装函数。它适用于任何 Go 应用程序。有关更多详细信息,请参阅crdb/README.md。testserver提供了启动本地 CockroachDB 实例并与之连接的函数。它适用于测试代码。
前提条件
本库的当前版本(v2)需要 Go modules。
您可以在代码中使用以下方式导入:
import (
"github.com/cockroachdb/cockroach-go/v2/crdb"
"github.com/cockroachdb/cockroach-go/v2/testserver"
)