File size: 1,394 Bytes
a1eed6b
 
0503b31
a1eed6b
0503b31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a1eed6b
0503b31
 
a1eed6b
0503b31
 
 
 
 
 
a1eed6b
 
0503b31
a1eed6b
0503b31
 
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
package proxy

import "math/rand"

var serviceUrls = map[string][]string{
	"crypto": {
		"https://qywok-cryptocurrency-prediction.hf.space/crypto",
		"https://qywok-cryptocurrency-prediction.hf.space/crypto",
		"https://qywok-cryptocurrency-prediction.hf.space/crypto",
		"https://qywok-cryptocurrency-prediction.hf.space/crypto",
		"https://qywok-cryptocurrency-prediction.hf.space/crypto",
	},
	"national": {
		"https://qywok-cryptocurrency-prediction.hf.space/crypto",
		"https://qywok-cryptocurrency-prediction.hf.space/crypto",
		"https://qywok-cryptocurrency-prediction.hf.space/crypto",
		"https://qywok-cryptocurrency-prediction.hf.space/crypto",
		"https://qywok-cryptocurrency-prediction.hf.space/crypto",
	},
	"stock": {
		"https://qywok-cryptocurrency-prediction.hf.space/crypto",
		"https://qywok-cryptocurrency-prediction.hf.space/crypto",
		"https://qywok-cryptocurrency-prediction.hf.space/crypto",
		"https://qywok-cryptocurrency-prediction.hf.space/crypto",
		"https://qywok-cryptocurrency-prediction.hf.space/crypto",
	},
}

func GetEndpointByRestService(svc_name string) string {
	var selectedUrls []string
	switch svc_name {
	case "crypto":
		selectedUrls = serviceUrls["crypto"]
	case "national":
		selectedUrls = serviceUrls["national"]
	default:
		selectedUrls = serviceUrls["stock"]
	}

	randomIndex := rand.Intn(len(selectedUrls))

	return selectedUrls[randomIndex]
}