go-client-rate-limiting

Configure adaptive token-bucket rate limiting in Go SDK clients.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/PremModhaOfficial/sdk-pipeline --skill go-client-rate-limiting
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-client-rate-limiting
Source: https://github.com/PremModhaOfficial/sdk-pipeline/tree/main/skills/go-client-rate-limiting
Command: npx skills add https://github.com/PremModhaOfficial/sdk-pipeline --skill go-client-rate-limiting

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill addresses the need to control API request rates in Go clients to prevent server overload and reduce client tail-latency by implementing token-bucket or leaky bucket rate limiting strategies with adaptive adjustments based on server feedback.

Core Features & Use Cases

  • Rate Limiting: Incorporates token bucket (rate.Limiter) for controlling request rates with support for bursts.
  • Adaptive Shaping: Adjusts request pacing dynamically based on Retry-After headers and server signals.
  • Per-Method Scoping: Enables distinct rate limits for different API endpoints, e.g., read vs write.
  • Use Case: A developer integrates this Skill into their Go SDK to ensure compliance with API quotas, enforcing controlled request pacing and handling throttling responses gracefully.

Quick Start

Implement the rate limiter in your Go SDK by initializing a rate.Limiter with desired parameters and invoking its Wait(ctx) method before making API calls.

Frequently Asked Questions about go-client-rate-limiting

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement rate limiting in a Go SDK client?

Implement rate limiting in a Go SDK by initializing a token-bucket rate.Limiter with desired parameters and invoking its Wait(ctx) method before making API calls to control request pacing and bursts.

What's the best way to handle API throttling and Retry-After headers in Golang?

Handle API throttling in Golang by using adaptive shaping, which dynamically adjusts request pacing based on server signals like Retry-After headers to reduce client tail-latency and prevent server overload.

Can I set different rate limits for individual API endpoints in a Go client?

Yes, you can configure per-method scoping to enforce distinct rate limits for different API endpoints, allowing separate request pacing controls for operations like reads versus writes.

How does a token bucket rate limiter manage bursts in Go SDK clients?

A token bucket rate limiter manages bursts in Go SDK clients by allowing a configurable spike of requests to pass through immediately, followed by a steady replenishment rate to maintain smooth request flow.

Why does my Go client experience high tail-latency when hitting API quotas?

Your Go client experiences high tail-latency because it lacks adaptive rate limiting, causing uncontrolled request volumes that trigger server throttling and delayed responses instead of smooth, paced API calls.

When do I need to add a leaky bucket or token bucket strategy to my Golang SDK?

You need to add a token bucket or leaky bucket strategy to your Golang SDK when integrating with APIs that enforce strict quotas, requiring controlled request pacing and graceful throttling response handling.