-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.go
More file actions
43 lines (36 loc) · 1.03 KB
/
config.go
File metadata and controls
43 lines (36 loc) · 1.03 KB
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
package pylon
type Strategy string
const (
RoundRobin Strategy = "round_robin"
LeastConnected Strategy = "least_connected"
Random Strategy = "random"
)
type Config struct {
Servers []Server `json:"servers"`
}
type Server struct {
Name string `json:"name"`
Port int `json:"port"`
HealthRoute string `json:"monitoring_route"`
Services []Service `json:"services"`
}
type Service struct {
Name string `json:"name"`
Pattern string `json:"route_pattern"`
Prefix string `json:"route_prefix"`
Instances []Instance `json:"instances"`
Strategy Strategy `json:"balancing_strategy"`
MaxCon int `json:"max_connections"`
HealthCheck HealthCheck `json:"health_check"`
}
type HealthCheck struct {
Enabled bool `json:"enabled"`
Interval int `json:"interval"`
DialTO int `json:"dial_timeout"`
}
type Instance struct {
Host string `json:"host"`
Weight float32 `json:"weight"`
ReqCount chan int
RRPos SharedInt
}