chore: caddy config file(json)
nginx: proxy version api
This commit is contained in:
55
pkg/model/caddy.go
Normal file
55
pkg/model/caddy.go
Normal file
@@ -0,0 +1,55 @@
|
||||
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
|
||||
Reference in New Issue
Block a user