Add Emberwake Cloud Ecosystem deploy hub with AWS and generic spread templates.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Unified expandable panels with mermaid flows, ZIP export, connection tests, and Playwright smoke coverage.
This commit is contained in:
41
server/internal/cloudmap/registry.go
Normal file
41
server/internal/cloudmap/registry.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package cloudmap
|
||||
|
||||
import "strings"
|
||||
|
||||
type RegistryDocument struct {
|
||||
Namespace string `json:"namespace"`
|
||||
Service string `json:"service"`
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
Instances []RegistryInstance `json:"instances"`
|
||||
}
|
||||
|
||||
type RegistryInstance struct {
|
||||
AgentID string `json:"agent_id"`
|
||||
DNSName string `json:"dns_name"`
|
||||
IP string `json:"ip"`
|
||||
FetchURL string `json:"fetch_url"`
|
||||
Port int `json:"port"`
|
||||
Healthy bool `json:"healthy"`
|
||||
}
|
||||
|
||||
func SeederDNSName(service, namespace string) string {
|
||||
if strings.TrimSpace(service) == "" {
|
||||
service = "seeder"
|
||||
}
|
||||
if strings.TrimSpace(namespace) == "" {
|
||||
namespace = "prod.local"
|
||||
}
|
||||
return strings.TrimSpace(service) + ".svc." + strings.TrimSpace(namespace)
|
||||
}
|
||||
|
||||
func NormalizeRegistryDocument(doc RegistryDocument) (RegistryDocument, bool) {
|
||||
doc.Namespace = strings.TrimSpace(doc.Namespace)
|
||||
doc.Service = strings.TrimSpace(doc.Service)
|
||||
if doc.Namespace == "" {
|
||||
doc.Namespace = "prod.local"
|
||||
}
|
||||
if doc.Service == "" {
|
||||
doc.Service = "seeder"
|
||||
}
|
||||
return doc, doc.Namespace != "" && doc.Service != ""
|
||||
}
|
||||
Reference in New Issue
Block a user