Backend: force_http1 (bool, default false) — zwingt HAProxy auf der Backend-Verbindung zu HTTP/1.1 statt h2,http/1.1 zu verhandeln. Nötig für Legacy-Apps die kein h2 sprechen. Domain: disable_h3 (bool, default false) — unterdrückt Alt-Svc- Response-Header für diese Domain. Browser erhalten keinen h3/QUIC- Hinweis und bleiben auf h2/http1.1. Migration 0027, Model+Service+HAProxy-Template+UI+i18n. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
39 lines
1.9 KiB
Go
39 lines
1.9 KiB
Go
package models
|
|
|
|
import "time"
|
|
|
|
// Backend ist eine Pool-Definition (Name, Scheme, Healthcheck, LB-Algo).
|
|
// Die konkreten Upstream-Server leben in BackendServer (1:N).
|
|
type Backend struct {
|
|
ID int64 `gorm:"primaryKey" json:"id"`
|
|
Name string `gorm:"column:name;uniqueIndex" json:"name"`
|
|
Scheme string `gorm:"column:scheme" json:"scheme"`
|
|
HealthCheckPath *string `gorm:"column:health_check_path" json:"health_check_path,omitempty"`
|
|
LBAlgorithm string `gorm:"column:lb_algorithm" json:"lb_algorithm"`
|
|
WebSocket bool `gorm:"column:websocket" json:"websocket"`
|
|
ForceHTTP1 bool `gorm:"column:force_http1" json:"force_http1"`
|
|
Active bool `gorm:"column:active" json:"active"`
|
|
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
|
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
|
}
|
|
|
|
func (Backend) TableName() string { return "backends" }
|
|
|
|
// BackendServer ist ein konkreter Upstream im Pool. weight steuert das
|
|
// LB-Verhältnis (roundrobin/leastconn); backup wird nur bedient wenn
|
|
// alle non-backup-Server down sind.
|
|
type BackendServer struct {
|
|
ID int64 `gorm:"primaryKey" json:"id"`
|
|
BackendID int64 `gorm:"column:backend_id" json:"backend_id"`
|
|
Name string `gorm:"column:name" json:"name"`
|
|
Address string `gorm:"column:address" json:"address"`
|
|
Port int `gorm:"column:port" json:"port"`
|
|
Weight int `gorm:"column:weight" json:"weight"`
|
|
Backup bool `gorm:"column:backup" json:"backup"`
|
|
Active bool `gorm:"column:active" json:"active"`
|
|
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
|
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
|
}
|
|
|
|
func (BackendServer) TableName() string { return "backend_servers" }
|