carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1package dbreads
2
3import (
4 "fmt"
5
6 "github.com/carlosframework/platform/internal/provision"
7)
8
9// ClassRefusal is the class rail as a sentence, or "" for an
10// activator-managed exec instance: the only class whose database the
11// platform replicates. It moved here from the console's db door so the door
12// and the box's identity bracket refuse on one rule (spec §8.2); the
13// sentences are the door's, unchanged.
14func ClassRefusal(rec provision.Record) string {
15 if k := rec.Kind; k != "" && k != "instance" {
16 return fmt.Sprintf("%s is a %s route. The platform keeps a database copy only for instances.", rec.Host, k)
17 }
18 if rec.Addr != "" || len(rec.Addrs) > 0 {
19 return fmt.Sprintf("%s is served from its own address, so the platform does not manage its database.", rec.Host)
20 }
21 if !rec.HibernateOrDefault() {
22 return fmt.Sprintf("%s does not sleep, so the platform does not keep a copy of its database.", rec.Host)
23 }
24 return ""
25}
26