Skip to content

Commit

Permalink
Add documentation for region filters
Browse files Browse the repository at this point in the history
  • Loading branch information
duncte123 committed Jan 18, 2024
1 parent fc31fc9 commit 5025631
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ enum class RegionFilterVerdict {
* You must register [dev.arbjerg.lavalink.client.loadbalancing.builtin.VoiceRegionPenaltyProvider] as a penalty provider in order for this filter to work.
*/
object RegionGroup {
/**
* An [IRegionFilter] for [VoiceRegion.SYDNEY], [VoiceRegion.INDIA], [VoiceRegion.JAPAN], [VoiceRegion.HONGKONG], [VoiceRegion.SINGAPORE], and [VoiceRegion.SOUTH_KOREA].
*/
@JvmField
val ASIA: IRegionFilter = object : IRegionFilter {
val regions = listOf(VoiceRegion.SYDNEY, VoiceRegion.INDIA, VoiceRegion.JAPAN, VoiceRegion.HONGKONG, VoiceRegion.SINGAPORE, VoiceRegion.SOUTH_KOREA)
Expand All @@ -29,6 +32,11 @@ object RegionGroup {
return if (region in regions) RegionFilterVerdict.PASS else RegionFilterVerdict.SOFT_BLOCK
}
}

/**
* An [IRegionFilter] for [VoiceRegion.ROTTERDAM], [VoiceRegion.RUSSIA], [VoiceRegion.AMSTERDAM], [VoiceRegion.MADRID], [VoiceRegion.MILAN],
* [VoiceRegion.BUCHAREST], [VoiceRegion.EUROPE], [VoiceRegion.LONDON], [VoiceRegion.FINLAND], [VoiceRegion.FRANKFURT], and [VoiceRegion.STOCKHOLM].
*/
@JvmField
val EUROPE: IRegionFilter = object : IRegionFilter {
val regions = listOf(VoiceRegion.ROTTERDAM, VoiceRegion.RUSSIA, VoiceRegion.AMSTERDAM, VoiceRegion.MADRID, VoiceRegion.MILAN,
Expand All @@ -38,6 +46,11 @@ object RegionGroup {
return if (region in regions) RegionFilterVerdict.PASS else RegionFilterVerdict.SOFT_BLOCK
}
}

/**
* An [IRegionFilter] for [VoiceRegion.US_CENTRAL], [VoiceRegion.US_EAST], [VoiceRegion.US_WEST], [VoiceRegion.US_SOUTH], [VoiceRegion.ATLANTA],
* [VoiceRegion.SEATTLE], [VoiceRegion.SANTA_CLARA], [VoiceRegion.NEWARK], [VoiceRegion.MONTREAL], [VoiceRegion.OREGON], and [VoiceRegion.ST_PETE].
*/
@JvmField
val US: IRegionFilter = object : IRegionFilter {
val regions = listOf(VoiceRegion.US_CENTRAL, VoiceRegion.US_EAST, VoiceRegion.US_SOUTH, VoiceRegion.US_WEST, VoiceRegion.ATLANTA,
Expand All @@ -47,6 +60,10 @@ object RegionGroup {
return if (region in regions) RegionFilterVerdict.PASS else RegionFilterVerdict.SOFT_BLOCK
}
}

/**
* An [IRegionFilter] for [VoiceRegion.BRAZIL], [VoiceRegion.SANTIAGO], and [VoiceRegion.BUENOS_AIRES].
*/
@JvmField
val SOUTH_AMERICA: IRegionFilter = object : IRegionFilter {
val regions = listOf(VoiceRegion.BRAZIL, VoiceRegion.SANTIAGO, VoiceRegion.BUENOS_AIRES)
Expand All @@ -55,6 +72,10 @@ object RegionGroup {
return if (region in regions) RegionFilterVerdict.PASS else RegionFilterVerdict.SOFT_BLOCK
}
}

/**
* An [IRegionFilter] for [VoiceRegion.SOUTH_AFRICA].
*/
@JvmField
val AFRICA: IRegionFilter = object : IRegionFilter {
val regions = listOf(VoiceRegion.SOUTH_AFRICA)
Expand All @@ -63,6 +84,10 @@ object RegionGroup {
return if (region in regions) RegionFilterVerdict.PASS else RegionFilterVerdict.SOFT_BLOCK
}
}

/**
* An [IRegionFilter] for [VoiceRegion.TEL_AVIV] and [VoiceRegion.DUBAI].
*/
@JvmField
val MIDDLE_EAST: IRegionFilter = object : IRegionFilter {
val regions = listOf(VoiceRegion.TEL_AVIV, VoiceRegion.DUBAI)
Expand Down

0 comments on commit 5025631

Please sign in to comment.