Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
6d28e06
feat(api): create internal/api package structure
mattmattox Dec 31, 2025
7daedbe
feat(api): implement route registration with groups
mattmattox Dec 31, 2025
8d7ecae
feat(api): implement middleware (auth, CORS, logging)
mattmattox Dec 31, 2025
3b24cce
feat(api): define comprehensive JSON request/response types
mattmattox Dec 31, 2025
215587b
feat(api): implement /health endpoint with component health checks
mattmattox Dec 31, 2025
098f467
feat(api): implement /api/v1/status endpoint with version and capacit…
mattmattox Dec 31, 2025
a247e98
feat(api): integrate API server into mount command
mattmattox Dec 31, 2025
dd68b18
feat(api): add CLI flags for API server configuration
mattmattox Dec 31, 2025
68450f4
feat(fs): add SnapshotRegistry() accessor for API endpoints
mattmattox Dec 31, 2025
760ffe5
feat(stats): create internal/stats package structure
mattmattox Dec 31, 2025
3e619d7
feat(stats): add TrimStats, SFBStats, and ClusterInfo types
mattmattox Dec 31, 2025
707e96f
feat(api): implement stats endpoints for cache, journal, trim, lock, …
mattmattox Dec 31, 2025
f5beb8c
style(api): gofmt the API and stats code
mattmattox Nov 10, 2026
a8146bf
fix(api): bind to loopback by default and refuse remote access withou…
mattmattox Nov 10, 2026
33b0bdc
fix(mount): warn at startup when broadcast runs without a secret
mattmattox Nov 10, 2026
4c94506
fix(api): read the build version from internal/version
mattmattox Nov 10, 2026
f1bbcf1
docs: document the HTTP API flags, loopback default and new warnings
mattmattox Nov 10, 2026
79c2ee5
test(stats): cover the filesystem provider
mattmattox Nov 10, 2026
e33a284
feat(api): add per-client rate limiting
mattmattox Dec 31, 2025
9688629
feat(api): serve Prometheus metrics on /metrics
mattmattox Dec 31, 2025
a8ce03c
feat(api): add /api/v1/cluster status, nodes and locks endpoints
mattmattox Dec 31, 2025
5eb160f
feat(gfsctl): add a CLI client for the HTTP API
mattmattox Dec 31, 2025
ab1feb3
feat(web): add a React dashboard for the HTTP API
mattmattox Jan 2, 2026
f58a6d3
fix(gfsctl): read the build version from internal/version
mattmattox Nov 10, 2026
e3619d7
docs: describe gfsctl, the dashboard and the new API endpoints
mattmattox Nov 10, 2026
e41d6c2
fix(api): use the collectors package for Go and process metrics
mattmattox Nov 10, 2026
78c425c
test(api): create the image file before sizing it
mattmattox Nov 10, 2026
5757ec2
Merge branch 'claude/land-api-work-c8b883' into claude/land-api-work-…
mattmattox Nov 10, 2026
76d66a8
fix(mount): skip API shutdown when the API never started
mattmattox Nov 10, 2026
e63e7f1
Merge branch 'claude/land-api-work-c8b883' into claude/land-api-work-…
mattmattox Nov 10, 2026
cbbcc4f
Merge remote-tracking branch 'origin/main' into claude/land-api-work-…
mattmattox Nov 10, 2026
69fc90b
Merge remote-tracking branch 'origin/claude/land-api-work-c8b883' int…
mattmattox Nov 10, 2026
5ad2809
Merge origin/main (#48 squash) into claude/land-api-work-uncommitted
mattmattox Nov 10, 2026
db94bf8
Merge remote-tracking branch 'origin/main' into claude/land-api-work-…
mattmattox Nov 10, 2026
2505935
refactor: move gfsctl, the dashboard and cluster endpoints to their o…
mattmattox Nov 10, 2026
8a1c408
fix(api): key the rate limiter on the connection and stop its cleanup
mattmattox Nov 10, 2026
673b055
feat(mount): add -api-rate-limit
mattmattox Nov 10, 2026
4f8b44e
docs: document -api-rate-limit and the Prometheus metrics
mattmattox Nov 10, 2026
e083900
fix(api): bound the rate limiter's memory and tighten its edges
mattmattox Nov 10, 2026
5382141
fix(mount): stop the rate limiter when the API fails to start
mattmattox Nov 10, 2026
6fa8c38
docs: describe the rate limiter's exempt paths, /64 grouping and clie…
mattmattox Nov 10, 2026
0232b2b
docs: say plainly how long a full rate limiter refuses new clients
mattmattox Nov 10, 2026
2094c0c
test(api): make the rate-limit burst test immune to slow hosts
mattmattox Nov 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
- CI gates: unit tests with the race detector and coverage, golangci-lint (`make lint`), govulncheck (`make vuln`), and a `go mod tidy` check.
- Release workflow: pushing a `v*` tag publishes a GitHub Release with `linux/amd64` and `linux/arm64` archives, checksums, and the matching `CHANGELOG.md` section. `scripts/dist.sh` builds the same archives locally.
- `goclusterfs-fsck -version` prints the release version, commit, and commit date.
- HTTP API in `goclusterfs-mount` (`-api`, on by default): `/health`, `/metrics`, `/api/v1/status` and `/api/v1/stats/...`. It listens on `127.0.0.1:8080` (`-api-addr`). Mount refuses a non-loopback `-api-addr` or `-api-cors '*'` without `-api-token`, and checks the API flags before it opens the device.
- HTTP API in `goclusterfs-mount` (`-api`, on by default): `/health`, `/metrics`, `/api/v1/status` and `/api/v1/stats/...`. It listens on `127.0.0.1:8080` (`-api-addr`). Mount refuses a non-loopback `-api-addr` or `-api-cors '*'` without `-api-token`, and checks the API flags before it opens the device. `/metrics` uses the Prometheus client library and adds Go runtime and process metrics. `-api-rate-limit` limits requests per client IP (off by default).
- `goclusterfs-mount -version`, which prints the same version string as `goclusterfs-fsck -version`. `/api/v1/status` reports it too.
- Mount logs a `WARNING` line at startup when `-broadcast` is on without `-broadcast-secret`.
- Design, deployment, operations, and troubleshooting docs in `docs/`.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ With `-broadcast` on and no `-broadcast-secret`, mount logs a `WARNING` line at
| `-api-addr` | `127.0.0.1:8080` | API listen address |
| `-api-token` | (empty) | Bearer token required on `/api/v1/...` |
| `-api-cors` | (empty) | Comma-separated CORS allowed origins |
| `-api-rate-limit` | `0` (off) | Requests per second per client IP, with bursts of twice that |

The API only listens on this host by default. Mount refuses to start when `-api-addr` can be reached from other hosts and `-api-token` is empty. See [HTTP API Flags](docs/API-CONFIG.md#http-api-flags).

Expand Down
17 changes: 14 additions & 3 deletions cmd/mount/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"flag"
"fmt"
"log"
"math"
"os"
"os/signal"
"strings"
Expand Down Expand Up @@ -78,17 +79,25 @@ func (p *fsStatusProvider) Capacity() *api.CapacityInfo {
}
}

func apiConfig(addr, token, corsList string) api.Config {
func apiConfig(addr, token, corsList string, rateLimit float64) api.Config {
var origins []string
for _, origin := range strings.Split(corsList, ",") {
if origin = strings.TrimSpace(origin); origin != "" {
origins = append(origins, origin)
}
}
return api.DefaultConfig().
cfg := api.DefaultConfig().
WithListenAddr(addr).
WithAuthToken(token).
WithCORSOrigins(origins...)
if rateLimit != 0 {
burst := 1
if rateLimit > 0 && rateLimit <= api.MaxRateLimit {
burst = int(math.Ceil(2 * rateLimit))
}
cfg = cfg.WithRateLimit(rateLimit, burst)
}
return cfg
}

func main() {
Expand Down Expand Up @@ -133,6 +142,7 @@ func main() {
apiAddr = flag.String("api-addr", "127.0.0.1:8080", "API server listen address; any non-loopback address needs -api-token")
apiToken = flag.String("api-token", "", "Bearer token for API authentication (empty=disabled, loopback only)")
apiCORS = flag.String("api-cors", "", "Comma-separated CORS allowed origins (empty=disabled)")
apiRate = flag.Float64("api-rate-limit", 0, "API requests per second per client IP, with bursts of twice that (0=off)")
)
flag.Parse()

Expand All @@ -147,7 +157,7 @@ func main() {
os.Exit(1)
}

apiCfg := apiConfig(*apiAddr, *apiToken, *apiCORS)
apiCfg := apiConfig(*apiAddr, *apiToken, *apiCORS, *apiRate)
if *apiEnabled {
if err := apiCfg.Validate(); err != nil {
log.Fatalf("Invalid API settings: %v", err)
Expand Down Expand Up @@ -457,6 +467,7 @@ func main() {
apiServer.RegisterHealthChecker(api.DefaultHealthChecker())
if err := apiServer.Start(ctx); err != nil {
log.Printf("Warning: Failed to start API server: %v", err)
apiServer.Stop()
apiServer = nil
} else {
log.Printf("API server listening on %s (auth=%v, cors=%v)",
Expand Down
5 changes: 4 additions & 1 deletion docs/API-CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,16 @@ The kernel caches file attributes and directory entries for `-attr-timeout`. For
| `-api-addr` | string | `127.0.0.1:8080` | Listen address |
| `-api-token` | string | (empty) | Bearer token for `/api/v1/...` requests |
| `-api-cors` | string | (empty) | Comma-separated CORS allowed origins, or `*` |
| `-api-rate-limit` | float | `0` (off) | Requests per second per client IP, with bursts of twice that, up to 1,000,000. Over the limit, the API answers 429 |

The API serves `GET /health`, `GET /metrics`, `GET /api/v1/status` and `GET /api/v1/stats/...`. Mount does not feed statistics to the API yet, so `/api/v1/stats/...` answers 503, `/health` only checks the API itself, and `/metrics` only reports `goclusterfs_up`. With `-api-token` set, `/api/v1/...` requests need `Authorization: Bearer <token>`. `/health` and `/metrics` never need the token.
The API serves `GET /health`, `GET /metrics`, `GET /api/v1/status` and `GET /api/v1/stats/...`. Mount does not feed statistics to the API yet, so `/api/v1/stats/...` answers 503, `/health` only checks the API itself, and `/metrics` only reports `goclusterfs_up` plus Go runtime and process metrics. With `-api-token` set, `/api/v1/...` requests need `Authorization: Bearer <token>`. `/health` and `/metrics` never need the token.

Without `-api-token`, the API answers only requests whose `Host` header is `localhost`, a `127.x` address or `[::1]`, so a web page cannot reach it through DNS rebinding, and mount refuses `-api-cors '*'`. List the dashboard's origin instead, for example `-api-cors http://localhost:5173`.

By default the API only accepts connections from this host. To serve other hosts, set `-api-addr` (for example `:8080` or `10.0.0.5:8080`) and `-api-token`. Mount exits before it opens the device when the address is not loopback (`127.0.0.0/8`, `::1` or `localhost`) and the token is empty. The token is a command-line flag, so local users can read it with `ps`.

The rate limit counts requests per connecting IP address, and per /64 for IPv6. It ignores `X-Forwarded-For`, so behind a proxy every client shares the proxy's limit. `/health` and `/metrics` are never limited. The limiter tracks at most 65,536 clients at once; while it is full, new clients get 429 until idle clients' buckets refill and are dropped, about 2 seconds (longer below 0.5 requests per second).

Each mount on a host needs its own `-api-addr`. When the port is taken, mount logs a warning and runs without the API.

---
Expand Down
17 changes: 16 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,19 @@ go 1.26.0

require github.com/hanwen/go-fuse/v2 v2.9.0

require golang.org/x/sys v0.28.0
require (
github.com/prometheus/client_golang v1.23.2
golang.org/x/sys v0.35.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.66.1 // indirect
github.com/prometheus/procfs v0.16.1 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
google.golang.org/protobuf v1.36.8 // indirect
)
46 changes: 44 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,50 @@
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/hanwen/go-fuse/v2 v2.9.0 h1:0AOGUkHtbOVeyGLr0tXupiid1Vg7QB7M6YUcdmVdC58=
github.com/hanwen/go-fuse/v2 v2.9.0/go.mod h1:yE6D2PqWwm3CbYRxFXV9xUd8Md5d6NG0WBs5spCswmI=
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg=
github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs=
github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA=
github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg=
github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc=
google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
50 changes: 43 additions & 7 deletions internal/api/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import (
"time"
)

// MaxRateLimit is the highest per-client rate limit, in requests per second.
const MaxRateLimit = 1e6

// Config holds the configuration for the API server.
type Config struct {
// ListenAddr is the address to listen on (e.g., "127.0.0.1:8080" or ":8080").
Expand Down Expand Up @@ -41,18 +44,33 @@ type Config struct {
// ShutdownTimeout is the maximum duration to wait for graceful shutdown.
// Default: 10s
ShutdownTimeout time.Duration

// RateLimitEnabled enables rate limiting middleware.
// Default: false
RateLimitEnabled bool

// RateLimitRequestsPerSecond is the sustained rate limit per client.
// Default: 100
RateLimitRequestsPerSecond float64

// RateLimitBurst is the maximum burst size (token bucket capacity).
// Default: 200
RateLimitBurst int
}

// DefaultConfig returns a Config with sensible defaults.
func DefaultConfig() Config {
return Config{
ListenAddr: "127.0.0.1:8080",
AuthToken: "",
CORSOrigins: nil,
ReadTimeout: 30 * time.Second,
WriteTimeout: 30 * time.Second,
IdleTimeout: 60 * time.Second,
ShutdownTimeout: 10 * time.Second,
ListenAddr: "127.0.0.1:8080",
AuthToken: "",
CORSOrigins: nil,
ReadTimeout: 30 * time.Second,
WriteTimeout: 30 * time.Second,
IdleTimeout: 60 * time.Second,
ShutdownTimeout: 10 * time.Second,
RateLimitEnabled: false,
RateLimitRequestsPerSecond: 100,
RateLimitBurst: 200,
}
}

Expand Down Expand Up @@ -118,6 +136,16 @@ func (c *Config) Validate() error {
}
}

// Validate rate limit configuration
if c.RateLimitEnabled {
if !(c.RateLimitRequestsPerSecond > 0) || c.RateLimitRequestsPerSecond > MaxRateLimit {
return fmt.Errorf("%w: requests per second must be more than 0 and at most %g", ErrInvalidRateLimit, MaxRateLimit)
}
if c.RateLimitBurst <= 0 {
return fmt.Errorf("%w: burst must be > 0", ErrInvalidRateLimit)
}
}

return nil
}

Expand Down Expand Up @@ -165,3 +193,11 @@ func (c Config) WithCORSOrigins(origins ...string) Config {
c.CORSOrigins = origins
return c
}

// WithRateLimit returns a copy of the config with rate limiting enabled.
func (c Config) WithRateLimit(requestsPerSecond float64, burst int) Config {
c.RateLimitEnabled = true
c.RateLimitRequestsPerSecond = requestsPerSecond
c.RateLimitBurst = burst
return c
}
3 changes: 3 additions & 0 deletions internal/api/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ var (

// ErrShutdownTimeout is returned when graceful shutdown times out.
ErrShutdownTimeout = errors.New("api: shutdown timed out")

// ErrInvalidRateLimit is returned when rate limit configuration is invalid.
ErrInvalidRateLimit = errors.New("api: invalid rate limit configuration")
)
Loading
Loading