You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
958 B

2 years ago
package domains
var Names T_Domains
type T_Domains struct {
Domains []T_Domain `json:"Domains"`
}
type T_Domain struct {
DomainName string `json:"DomainName"`
RealServer string `json:"RealServer"`
RealPort string `json:"RealPort"`
Status string `json:"Satus"`
}
const (
Onboarding = "Onboarding"
NotPointedToUs = "NotPointedToUs"
Working = "Working"
Unoperational = "Unoperational"
)
func (T_Domains) AddByDomain(domain T_Domain) {
Names.Domains = append(Names.Domains, domain)
}
func (T_Domains) AddByParams(name string, realServer string, realPort string) {
var temp T_Domain
temp.DomainName = name
temp.RealServer = realServer
temp.RealPort = realPort
temp.Status = Onboarding
Names.AddByDomain(temp)
}
func (T_Domains) RemoveDomain(name string) {
for index, v := range Names.Domains {
if v.DomainName == name {
temp := append(Names.Domains[:index], Names.Domains[index+1])
Names.Domains = temp
}
}
}