// PreReadRequest can limit request processing.
PreReadRequest can limit request processing.
// PreReadRequest can limit request processing .
func (plugin *RedisRateLimitingPlugin) PreCall(ctx context.Context, servicePath, serviceMethod string, args interface{}) error {
	res, err := plugin.limiter.Allow(ctx, servicePath+"/"+serviceMethod, plugin.limit)
	if err != nil {
		return err
	}
	if res.Allowed > 0 {
		return nil
	}
	return server.ErrReqReachLimit
}
func ( plugin * RedisRateLimitingPlugin ) PreCall ( ctx context . Context , servicePath , serviceMethod string , args interface { } ) error { res , err := plugin . limiter . Allow ( ctx , servicePath + " " + serviceMethod , plugin . limit ) if err != nil { return err } if res . Allowed > 0 { return nil } return server . ErrReqReachLimit }
PreReadRequest can limit request processing.
PreReadRequest can limit request processing .