io.github.dengchen2020.ratelimiter.properties.RateLimiterBuilder Maven / Gradle / Ivy
package io.github.dengchen2020.ratelimiter.properties;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* 限流属性配置
* @author dengchen
* @since 2024/7/1
*/
@ConfigurationProperties(prefix = "dc.ratelimiter")
public class RateLimiterBuilder {
/**
* 是否开启限流
*/
private boolean enable = true;
/**
* 默认为单机限流
*/
private Type type = Type.local;
public boolean isEnable() {
return enable;
}
public void setEnable(boolean enable) {
this.enable = enable;
}
public Type getType() {
return type;
}
public void setType(Type type) {
this.type = type;
}
public enum Type {
/**
* 单机限流,默认选项,性能较高
*/
local
}
}