All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.dengchen2020.ratelimiter.properties.RateLimiterBuilder Maven / Gradle / Ivy

There is a newer version: 0.0.28
Show newest version
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
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy