feat: 加入渠道加权随机功能

This commit is contained in:
CaIon
2023-12-27 19:00:47 +08:00
parent 1a8a24698f
commit bdd611fd33
5 changed files with 86 additions and 8 deletions

View File

@@ -113,6 +113,13 @@ func (channel *Channel) GetPriority() int64 {
return *channel.Priority
}
func (channel *Channel) GetWeight() int {
if channel.Weight == nil {
return 0
}
return int(*channel.Weight)
}
func (channel *Channel) GetBaseURL() string {
if channel.BaseURL == nil {
return ""