Documentation
¶
Overview ¶
Package deploymentv1 holds the types of the deployment configuration, version 1, generated from the schemas in deployment/schemas by tools/types (R72 and R85 in spec's docs/decisions.md): the file /deployment.json, whose fields keep the names of R09 app, in camelCase, as their JSON tags, and the vectors of reading. There is a type for each schema and for each of its $defs, and for each enumeration of a field. A vector's file is any JSON value, json.RawMessage, as a reader gets it. The schemas decide what is valid: a type gives the shape of a value alone, and code that reads a value from elsewhere checks it against its schema first, and then against the rules of reading (deployment/README.md, section 5). A field the object always holds is a value; any other is a pointer, a slice or a map, left out when nil, so that a value read and written again is the same JSON. Another version of the format is a package of its own.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Case ¶
type Case struct {
// The origin where app is open, as the URL Standard serializes it.
Origin string `json:"origin"`
// The file as JSON reads it: any JSON value, not only one the schema accepts.
File json.RawMessage `json:"file"`
// The step that refuses the file: the schema, or the ID of the rule. Left out when the reader
// accepts the file.
RefusedBy *CaseRefusedBy `json:"refused_by,omitzero"`
// Every field that step refuses, in the order of code units.
Fields []string `json:"fields,omitzero"`
}
Case is the type of reading-vector.schema.json#/$defs/case.
type CaseRefusedBy ¶
type CaseRefusedBy string
CaseRefusedBy is the type of reading-vector.schema.json#/$defs/case/properties/refused_by.
The step that refuses the file: the schema, or the ID of the rule. Left out when the reader accepts the file.
const ( CaseRefusedBySchema CaseRefusedBy = "schema" CaseRefusedByDeploymentAPIOrigin CaseRefusedBy = "deployment.api-origin" CaseRefusedByDeploymentLoopback CaseRefusedBy = "deployment.loopback" )
The values of CaseRefusedBy.
type Deployment ¶
type Deployment struct {
// The version of the format, the integer in deployment/VERSION.
Format int64 `json:"format"`
// The origin of api: a scheme, a host in lower case and perhaps a port, with no path, query,
// fragment or credentials; https, or http on a loopback host. That it is equal to its own
// origin, and that http needs app itself on a loopback host, are rules of reading (section 5).
API string `json:"api"`
// The sign-in service and the parameters of its project.
SignIn SignIn `json:"signIn"`
}
Deployment is the type of deployment.schema.json.
The file /deployment.json, which app reads at every start from the root of its origin, beside its signed build (section 4 of the deployment text). It holds no secret: every browser that opens app gets it.
type Parameter ¶
type Parameter string
Parameter is the type of deployment.schema.json#/$defs/parameter.
type ReadingVector ¶
type ReadingVector struct {
// The files, each read once.
Cases []Case `json:"cases"`
}
ReadingVector is the type of reading-vector.schema.json.
A test vector of reading (section 7 of the deployment text): files of a deployment configuration, each with the origin where app is open and what section 5 gives. A reader implements section 5 and gets exactly this.
type SignIn ¶
type SignIn struct {
// The sign-in service: Firebase Auth. Another service is another adapter, in api and in app.
Service string `json:"service"`
// The key of the Firebase web app, as the Firebase console gives it.
APIKey Parameter `json:"apiKey"`
// The host of the Firebase sign-in pages, with no scheme and no path, such as
// example-project.firebaseapp.com.
AuthDomain string `json:"authDomain"`
// The ID of the Firebase project.
ProjectID Parameter `json:"projectId"`
// The ID of the Firebase web app.
AppID Parameter `json:"appId"`
}
SignIn is the type of deployment.schema.json#/$defs/sign_in.