Documentation
¶
Index ¶
- func ActivityHTTPMiddleware(activityClient *activity.Client, source runtime.RequestSource) func(http.Handler) http.Handler
- func ActivityStreamServerInterceptor(activityClient *activity.Client) grpc.StreamServerInterceptor
- func ActivityUnaryServerInterceptor(activityClient *activity.Client) grpc.UnaryServerInterceptor
- func CacheControlMiddleware(next http.Handler) http.Handler
- func Check(checkFn CheckFunc, next http.Handler) httputil.Handler
- func TimeoutMCPMiddleware(fn func(method, tool string) time.Duration) mcp.Middleware
- func TimeoutStreamServerInterceptor(fn func(method string) time.Duration) grpc.StreamServerInterceptor
- func TimeoutUnaryServerInterceptor(fn func(method string) time.Duration) grpc.UnaryServerInterceptor
- func TraceMiddleware(next http.Handler) http.Handler
- type CheckFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActivityHTTPMiddleware ¶ added in v0.88.0
func ActivityHTTPMiddleware(activityClient *activity.Client, source runtime.RequestSource) func(http.Handler) http.Handler
ActivityHTTPMiddleware emits the request_time_ms usage metric for HTTP API requests that don't pass through the gRPC interceptor (e.g. the custom REST API and MCP). Together with the gRPC interceptors this gives one request event per API call across all surfaces, tagged with the given source. Billing logic (which sources count, distinct embedded users, etc.) is applied downstream in the metrics project.
func ActivityStreamServerInterceptor ¶ added in v0.31.0
func ActivityStreamServerInterceptor(activityClient *activity.Client) grpc.StreamServerInterceptor
func ActivityUnaryServerInterceptor ¶ added in v0.31.0
func ActivityUnaryServerInterceptor(activityClient *activity.Client) grpc.UnaryServerInterceptor
func CacheControlMiddleware ¶ added in v0.86.1
CacheControlMiddleware sets a default Cache-Control header of "no-store, no-cache, must-revalidate". Handlers that need different caching behavior (e.g. static assets) can override it by calling w.Header().Set("Cache-Control", ...) before their first write.
func Check ¶ added in v0.42.0
Check is a middleware that only calls the next handler if the checkFn succeeds. If the checkFn fails, the error is written to the response as per the behavior of httputil.Handler.
func TimeoutMCPMiddleware ¶ added in v0.78.0
func TimeoutMCPMiddleware(fn func(method, tool string) time.Duration) mcp.Middleware
func TimeoutStreamServerInterceptor ¶
func TimeoutStreamServerInterceptor(fn func(method string) time.Duration) grpc.StreamServerInterceptor
func TimeoutUnaryServerInterceptor ¶
func TimeoutUnaryServerInterceptor(fn func(method string) time.Duration) grpc.UnaryServerInterceptor