56 lines
1.2 KiB
Go
56 lines
1.2 KiB
Go
package model
|
|
|
|
type CaddyUpstream struct {
|
|
Dial []string `json:"dial"`
|
|
}
|
|
|
|
type CaddyActive struct {
|
|
Interval string `json:"interval"`
|
|
Timeout string `json:"timeout"`
|
|
Port int `json:"port"`
|
|
}
|
|
|
|
type CaddyPassive struct {
|
|
MaxFails int `json:"max_fails"`
|
|
FailDuration string `json:"fail_duration"`
|
|
}
|
|
|
|
type CaddyHealthCheck struct {
|
|
Active *CaddyActive `json:"active"`
|
|
Passive *CaddyPassive `json:"passive"`
|
|
}
|
|
|
|
type CaddySelection struct {
|
|
Policy string `json:"policy"`
|
|
}
|
|
|
|
type CaddyLoadBalancing struct {
|
|
Selection *CaddySelection `json:"selection"`
|
|
}
|
|
|
|
type CaddyHandle struct {
|
|
Handler string `json:"handler"`
|
|
Upstreams []*CaddyUpstream `json:"upstreams"`
|
|
HealthChecks *CaddyHealthCheck `json:"health_checks"`
|
|
LoadBalancing *CaddyLoadBalancing `json:"load_balancing"`
|
|
}
|
|
|
|
type CaddyRoute struct {
|
|
Handle []*CaddyHandle `json:"handle"`
|
|
}
|
|
|
|
type CaddyServer struct {
|
|
Listen []string `json:"listen"`
|
|
Routes []*CaddyRoute `json:"routes"`
|
|
}
|
|
|
|
type CaddyLayer4 struct {
|
|
Servers map[string]*CaddyServer `json:"servers"`
|
|
}
|
|
|
|
type CaddyApp struct {
|
|
Layer4 *CaddyLayer4 `json:"layer4"`
|
|
}
|
|
|
|
type CaddyConfig map[string]*CaddyApp
|