package dbreads import ( "fmt" "github.com/carlosframework/platform/internal/provision" ) // ClassRefusal is the class rail as a sentence, or "" for an // activator-managed exec instance: the only class whose database the // platform replicates. It moved here from the console's db door so the door // and the box's identity bracket refuse on one rule (spec ยง8.2); the // sentences are the door's, unchanged. func ClassRefusal(rec provision.Record) string { if k := rec.Kind; k != "" && k != "instance" { return fmt.Sprintf("%s is a %s route. The platform keeps a database copy only for instances.", rec.Host, k) } if rec.Addr != "" || len(rec.Addrs) > 0 { return fmt.Sprintf("%s is served from its own address, so the platform does not manage its database.", rec.Host) } if !rec.HibernateOrDefault() { return fmt.Sprintf("%s does not sleep, so the platform does not keep a copy of its database.", rec.Host) } return "" }