forked from mtusi2026/mtusi2026lab6
feat: add bounded observability and verified SLO incident alerts
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package admission
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
)
|
||||
|
||||
// ErrRate means the request exhausted a shared rate budget.
|
||||
var ErrRate = errors.New("shared request rate exceeded")
|
||||
|
||||
// ErrSlots means the request exhausted a shared concurrency budget.
|
||||
var ErrSlots = errors.New("shared execution slots exhausted")
|
||||
|
||||
// Distributed defines request admission independently of the backing database.
|
||||
type Distributed interface {
|
||||
// Enter reserves global/group or user/group budgets and returns a release operation.
|
||||
Enter(ctx context.Context, group, user string) (func(), error)
|
||||
}
|
||||
Reference in New Issue
Block a user