rename domain type

This commit is contained in:
pascal
2026-02-12 16:15:02 +01:00
parent fe975fb834
commit db5e26db94
2 changed files with 9 additions and 9 deletions
@@ -1,17 +1,17 @@
package domain package domain
type DomainType string type Type string
const ( const (
TypeFree DomainType = "free" TypeFree Type = "free"
TypeCustom DomainType = "custom" TypeCustom Type = "custom"
) )
type Domain struct { type Domain struct {
ID string `gorm:"unique;primaryKey;autoIncrement"` ID string `gorm:"unique;primaryKey;autoIncrement"`
Domain string `gorm:"unique"` // Domain records must be unique, this avoids domain reuse across accounts. Domain string `gorm:"unique"` // Domain records must be unique, this avoids domain reuse across accounts.
AccountID string `gorm:"index"` AccountID string `gorm:"index"`
TargetCluster string // The proxy cluster this domain should be validated against TargetCluster string // The proxy cluster this domain should be validated against
Type DomainType `gorm:"-"` Type Type `gorm:"-"`
Validated bool Validated bool
} }
@@ -28,7 +28,7 @@ func RegisterEndpoints(router *mux.Router, manager Manager) {
router.HandleFunc("/domains/{domainId}/validate", h.triggerCustomDomainValidation).Methods("GET", "OPTIONS") router.HandleFunc("/domains/{domainId}/validate", h.triggerCustomDomainValidation).Methods("GET", "OPTIONS")
} }
func domainTypeToApi(t domain.DomainType) api.ReverseProxyDomainType { func domainTypeToApi(t domain.Type) api.ReverseProxyDomainType {
switch t { switch t {
case domain.TypeCustom: case domain.TypeCustom:
return api.ReverseProxyDomainTypeCustom return api.ReverseProxyDomainTypeCustom