Documentation
¶
Overview ¶
Package webabi is the TxCo Web ABI on the installing side: the manifest (txco-web.json), a loaded ABI directory, the marker and provenance files an install writes, and the collision rules for laying an ABI directory over an author's stack tree. It has no CLI dependencies; `txco apply`, `txco push`, `txco dev` and `txco web check` build on it.
An ABI directory is a producer's build output:
txco-web.json the manifest: what the artifact is, never its routing public/ files, installed as the stack's FILES/ server/ an optional Fetch handler module (refused until a runner exists) ops/ ordinary .txcl in scope directories (ops/900000/…)
Index ¶
Constants ¶
const ( // ManifestName is the manifest's file name at the root of an ABI directory. ManifestName = "txco-web.json" // ABIVersion is the manifest's abi value this package reads. ABIVersion = 1 // ProducerScope starts the scope band producers' ops live in, after // every op an author writes. ProducerScope = 900000 )
const MarkerContent = "txco web abi marker\n"
MarkerContent is every marker's body. Static reads markers by path only; the body just keeps the file non-empty.
const ProvenancePath = "FILES/" + static.MarkerDir + "/web-abi.json"
ProvenancePath is the stack path of the file that lists every path an install owns, so `txco pull` can leave them out of the author's tree. It lives under FILES/_txco/, private like any "_" path.
Variables ¶
This section is empty.
Functions ¶
func CheckOverlay ¶
CheckOverlay reports every way an ABI install would collide with the author's own stack tree, as messages naming both sides. author and abi are the stack paths each side contributes ("100/a.txcl", "100/mock-request.json", "FILES/x.js", the markers, the provenance file). An empty result means the two lay over each other cleanly.
- the same path from both sides (an op, a scope's mock, a file);
- an author file under a "_" root public/ makes public: it would be served too;
- an author file under an immutable prefix: it would be cached for a year;
- any author FILES/_txco/: the installer owns it in a bound stack.
func ParseProvenance ¶
ParseProvenance reads a provenance file's owned paths.
func Provenance ¶
Provenance renders the provenance file for an install that owns paths (stack paths; the file itself is added).
Types ¶
type Dir ¶
type Dir struct {
// Path is the directory, absolute.
Path string
Manifest *Manifest
// Public is every file under public/, as a FILES/-relative path (the
// stack path is "FILES/" + it), sorted. Dot paths and symlinks are not
// in it: they never deploy.
Public []string
// HasServer: the manifest names a server entry.
HasServer bool
// HasOps: an ops/ directory exists.
HasOps bool
// Warnings are worth telling the author but don't stop an install.
Warnings []string
}
Dir is a loaded ABI directory.
func Load ¶
Load reads and checks an ABI directory. It reads paths only, never the bytes of public/ (collecting them is the installer's job).
func (*Dir) Markers ¶
Markers returns the stack paths (FILES/…) of the markers an install writes, sorted: one public marker per private root public/ installs, one immutable marker per manifest prefix.
func (*Dir) PublicRoots ¶
PublicRoots are the private roots (paths cut at their first "_" segment) public/ installs, sorted: each gets a public marker.
type Manifest ¶
type Manifest struct {
ABI int `json:"abi"`
Server *Server `json:"server,omitempty"`
Immutable []string `json:"immutable,omitempty"`
}
Manifest is txco-web.json.
func ParseManifest ¶
ParseManifest validates data against the manifest schema, then the rules a schema can't express, and decodes it.
func ReadManifest ¶
ReadManifest reads and parses <dir>/txco-web.json.
func (*Manifest) ImmutablePrefixes ¶
ImmutablePrefixes returns the manifest's immutable prefixes, each ending in "/", sorted.
type ManifestError ¶
type ManifestError struct {
Problems []Problem
}
ManifestError lists everything wrong with a manifest.
func (*ManifestError) Error ¶
func (e *ManifestError) Error() string