Documentation
¶
Overview ¶
Package bootstrap is the adapter to GTT Bootstrap: it resolves, verifies and installs a catalog, and runs declared operations through the Bootstrap's contract entry point. It holds no GTT semantics.
Index ¶
- Constants
- Variables
- func Layout(pkg ports.Package) (ports.CoreLayout, error)
- func LocalReasons(rel ports.Release, caps []ports.Capability) []string
- func TrustedKeys(dir string) (map[string]ed25519.PublicKey, error)
- type Factory
- type Installer
- func (Installer) Conflicts(pkg ports.Package, projectRoot string) ([]string, error)
- func (i Installer) Install(pkg ports.Package, projectRoot string) (map[string]string, error)
- func (Installer) Layout(pkg ports.Package) (ports.CoreLayout, error)
- func (Installer) Remove(projectRoot string, layout ports.CoreLayout) error
- type Resolver
- type Runtime
- func (r *Runtime) Capabilities(ctx context.Context) ([]ports.Capability, error)
- func (r *Runtime) CheckContracts(ctx context.Context) ([]string, error)
- func (r *Runtime) Execute(ctx context.Context, req ports.OperationRequest) (ports.OperationResult, error)
- func (r *Runtime) Negotiate(ctx context.Context) (ports.Negotiation, error)
- func (r *Runtime) Operations(ctx context.Context) (map[string]ports.Operation, error)
- func (r *Runtime) Release(ctx context.Context) (ports.Release, error)
- func (r *Runtime) Root() string
- func (r *Runtime) Show(ctx context.Context, contract string) (json.RawMessage, error)
- type Signer
Constants ¶
const CanonicalSource = "https://github.com/GTT-Community/gtt-bootstrap.git"
CanonicalSource is the canonical distribution source of GTT Bootstrap.
const SignatureFile = ".gtt/contract/release.sig"
SignatureFile is the detached release signature a Bootstrap package may carry. It signs the content checksum of every other file of the package.
Variables ¶
var Now = func() time.Time { return time.Now().UTC() }
Now is the clock used for resolution records.
Functions ¶
func Layout ¶
func Layout(pkg ports.Package) (ports.CoreLayout, error)
Layout reads from the scaffold manifest what the portable core is: the engine and domain layers, the entry points, the engine paths it declares as derived or as state and, when declared, where the initial-source tracking record lives. Only installation structure is read; nothing else in the manifest is interpreted here.
func LocalReasons ¶
func LocalReasons(rel ports.Release, caps []ports.Capability) []string
LocalReasons are the CLI's own reasons to refuse a Bootstrap.
Types ¶
type Installer ¶
type Installer struct{}
Installer stages and commits the portable core.
func (Installer) Conflicts ¶
Conflicts lists core paths that already exist in the project. A conflict is reported, never merged.
func (Installer) Install ¶
Install stages the core next to the project, then commits it with one rename per top-level path. On any failure everything it created is removed.
type Resolver ¶
type Resolver struct {
Runner ports.Runner
Factory ports.BootstrapFactory
Home string // user-level GTT home (cache lives under it)
Remote string // configured distribution source; empty = canonical
// KeysDir holds the trusted release keys. When it holds any, every
// package must carry a signature that verifies against one of them.
KeysDir string
}
Resolver finds a Bootstrap catalog in this order: explicit path, the source the project recorded, the verified user cache, the configured source, the canonical source. A download is always one release tag: it never picks an unknown version, or a branch head, silently.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime talks to one Bootstrap tree.
func (*Runtime) Capabilities ¶
Capabilities returns the capability registry.
func (*Runtime) CheckContracts ¶
CheckContracts returns the problems the Bootstrap finds in its own contracts.
func (*Runtime) Execute ¶
func (r *Runtime) Execute(ctx context.Context, req ports.OperationRequest) (ports.OperationResult, error)
Execute runs one declared operation. An operation the Bootstrap does not declare is refused here, before anything is run.
func (*Runtime) Negotiate ¶
Negotiate asks the Bootstrap whether this CLI is compatible and then applies the CLI-side checks. Anything unknown is an incompatibility.
func (*Runtime) Operations ¶
Operations returns the operation registry (cached per runtime).
type Signer ¶
type Signer struct {
Factory ports.BootstrapFactory
}
Signer creates release keys and signs Bootstrap packages. It is the tool of whoever publishes a Bootstrap release, never part of verification.