|
| 1 | +package dev.lavalink.youtube.plugin; |
| 2 | + |
| 3 | +import org.springframework.boot.context.properties.ConfigurationProperties; |
| 4 | +import org.springframework.stereotype.Component; |
| 5 | + |
| 6 | +import java.util.Collections; |
| 7 | +import java.util.List; |
| 8 | + |
| 9 | +@ConfigurationProperties(prefix = "lavalink.server.ratelimit") |
| 10 | +@Component |
| 11 | +public class RatelimitConfig { |
| 12 | + private List<String> ipBlocks = Collections.emptyList(); |
| 13 | + private List<String> excludedIps = Collections.emptyList(); |
| 14 | + private String strategy = "RotatingNanoSwitch"; |
| 15 | + private int retryLimit = -1; |
| 16 | + private boolean searchTriggersFail = true; |
| 17 | + |
| 18 | + public List<String> getIpBlocks() { |
| 19 | + return this.ipBlocks; |
| 20 | + } |
| 21 | + |
| 22 | + public List<String> getExcludedIps() { |
| 23 | + return this.excludedIps; |
| 24 | + } |
| 25 | + |
| 26 | + public String getStrategy() { |
| 27 | + return this.strategy; |
| 28 | + } |
| 29 | + |
| 30 | + public int getRetryLimit() { |
| 31 | + return this.retryLimit; |
| 32 | + } |
| 33 | + |
| 34 | + public boolean getSearchTriggersFail() { |
| 35 | + return this.searchTriggersFail; |
| 36 | + } |
| 37 | + |
| 38 | + public void setIpBlocks(List<String> ipBlocks) { |
| 39 | + this.ipBlocks = ipBlocks; |
| 40 | + } |
| 41 | + |
| 42 | + public void setExcludedIps(List<String> excludedIps) { |
| 43 | + this.excludedIps = excludedIps; |
| 44 | + } |
| 45 | + |
| 46 | + public void setStrategy(String strategy) { |
| 47 | + this.strategy = strategy; |
| 48 | + } |
| 49 | + |
| 50 | + public void setRetryLimit(int retryLimit) { |
| 51 | + this.retryLimit = retryLimit; |
| 52 | + } |
| 53 | + |
| 54 | + public void setSearchTriggersFail(boolean searchTriggersFail) { |
| 55 | + this.searchTriggersFail = searchTriggersFail; |
| 56 | + } |
| 57 | +} |
0 commit comments