mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-25 22:09:08 +01:00
rename domain type
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user