Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 4.5% on proxy.golang.org
Top 0.9% forks on proxy.golang.org

proxy.golang.org : github.com/alibaba/sentinel-golang/pkg/adapters/go-zero

This package provides Sentinel integration for go-zero. go-zero provides both zrpc and rest modules. For go-zero/zrpc, user can call `AddUnaryInterceptors` and `AddStreamInterceptors` on zrpc.RpcServer or `WithUnaryClientInterceptor` on zrpc.ClientOption to add grpc interceptors. For go-zero/rest, there are two kinds of middlewares. The first one is the global middleware, which can be applied to rest.Server via: The plugin extracts service FullMethod as the resource name by default. Users may provide customized resource name extractor when creating new Sentinel interceptors (via options). Fallback logic: the plugin will return the BlockError by default if current request is blocked by Sentinel rules. Users may also provide customized fallback logic via WithXxxBlockFallback(handler) options. The second one is the routing middleware, which is registered to specific routes via by go-zero automatically. Therefore, it is recomended to create routing middleware based on the generated templates. An example with Sentinel based on go-zero template is provided in `routing_middleware`. The calling order is first global ones, then routing ones.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/alibaba/sentinel-golang/pkg/adapters/go-zero
Keywords: cloud-native, go, golang, microservice, microservices, middleware, rate-limiting, resiliency
License: Apache-2.0
Latest release: 11 months ago
First release: over 1 year ago
Namespace: github.com/alibaba/sentinel-golang/pkg/adapters
Stars: 2,334 on GitHub
Forks: 385 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: about 19 hours ago

    Loading...
    Readme
    Loading...