Spaces:
Sleeping
Sleeping
File size: 1,485 Bytes
a1eed6b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
package proxy
import "time"
func GetEndpointByRestService(svc_name string) string {
second := time.Now().Second()
var divisorToString map[int]string
switch svc_name {
case "crypto":
divisorToString = map[int]string{
9: "https://qywok-cryptocurrency-prediction.hf.space/crypto",
7: "https://qywok-cryptocurrency-prediction.hf.space/crypto",
5: "https://qywok-cryptocurrency-prediction.hf.space/crypto",
3: "https://qywok-cryptocurrency-prediction.hf.space/crypto",
2: "https://qywok-cryptocurrency-prediction.hf.space/crypto",
}
case "national":
divisorToString = map[int]string{
9: "https://qywok-cryptocurrency-prediction.hf.space/crypto",
7: "https://qywok-cryptocurrency-prediction.hf.space/crypto",
5: "https://qywok-cryptocurrency-prediction.hf.space/crypto",
3: "https://qywok-cryptocurrency-prediction.hf.space/crypto",
2: "https://qywok-cryptocurrency-prediction.hf.space/crypto",
}
default:
divisorToString = map[int]string{
9: "https://qywok-cryptocurrency-prediction.hf.space/crypto",
7: "https://qywok-cryptocurrency-prediction.hf.space/crypto",
5: "https://qywok-cryptocurrency-prediction.hf.space/crypto",
3: "https://qywok-cryptocurrency-prediction.hf.space/crypto",
2: "https://qywok-cryptocurrency-prediction.hf.space/crypto",
}
}
var result string
for divisor, str := range divisorToString {
if (second % divisor) == 0 {
result += str
break
}
}
return result
} |