Documentation
¶
Overview ¶
package project selects and evaluates project configuration, including TypeScript files. config owns static types and validation; resolve combines the selected source with server, team, and saved client state. this package does not start publishers or connectors.
Index ¶
- Constants
- func ConfigNames() []string
- func ServiceWorktreeLabel(service string, worktree Worktree) string
- func SharedProjectIdentity(worktree Worktree, projectRoot string) string
- func SharedProjectLabel(role string, worktree Worktree, projectRoot string, salt [32]byte) string
- func TypeScriptKeyMappings() map[string]string
- type LocalIdentityStore
- type LocalPublicationIdentity
- type Project
- func (p Project) AppService(cwd, selected string) (string, error)
- func (p Project) BindLocalIdentity(ctx context.Context, store LocalIdentityStore) (Project, error)
- func (p Project) CaptureServiceTrust(ctx context.Context, name, target string) (*targettrust.Snapshot, error)
- func (p Project) CaptureTargetTrust(ctx context.Context, name, discovered string) (*targettrust.Declaration, error)
- func (p Project) ComposeFile(name string) (string, error)
- func (p Project) ComposeProject(name string) (string, error)
- func (p Project) EffectiveService(name string) (ResolvedService, error)
- func (p Project) Found() bool
- func (p Project) GitHubRepository(ctx context.Context) (string, error)
- func (p Project) LocalPublicationIdentity() LocalPublicationIdentity
- func (p Project) LocalWorktreeKey() string
- func (p Project) ResolvePublish(name, discovered string) (*config.Publish, error)
- func (project Project) SelectDeployment(name string) (Project, error)
- func (p Project) Snapshot() ([]byte, string, error)
- func (p Project) SourceIdentity(ctx context.Context) (SourceIdentity, error)
- type ProjectContext
- type ResolvedService
- type Selection
- type SourceIdentity
- type Worktree
- type WorktreeLabel
Constants ¶
const MaxSnapshotBytes = 1 << 20
Variables ¶
This section is empty.
Functions ¶
func ConfigNames ¶
func ConfigNames() []string
ConfigNames returns the supported project configuration filenames in discovery order.
func ServiceWorktreeLabel ¶
ServiceWorktreeLabel returns the built-in hostname label for one service.
func SharedProjectIdentity ¶
SharedProjectIdentity is the checkout-independent local state key.
func SharedProjectLabel ¶
SharedProjectLabel gives linked worktrees one label for project integration URLs.
func TypeScriptKeyMappings ¶
TypeScriptKeyMappings returns the static-to-TypeScript property mappings used by evaluation and declaration generation.
Types ¶
type LocalIdentityStore ¶
type LocalPublicationIdentity ¶
LocalPublicationIdentity identifies configured development services in one checkout. Git moves, origin changes, and branches do not change it. it is not a portable source identity for apply or workloads.
type Project ¶
type Project struct {
Selection Selection
Config config.TNL
Declared *config.Project
Deployment string
Worktree Worktree
Root string
// contains filtered or unexported fields
}
Project is a selected and resolved project configuration.
func Resolve ¶
Resolve loads a selected project configuration and resolves its worktree and configuration. an empty selection still resolves cwd as a project so commands without a configuration file share the same identity.
func (Project) AppService ¶
AppService selects a configured app target. cwd identifies the project only; when more than one app is configured, the caller must select one by name.
func (Project) BindLocalIdentity ¶
BindLocalIdentity is composed after static project evaluation, with protected local state. source identity for remote apply and workloads is independent.
func (Project) CaptureServiceTrust ¶
func (p Project) CaptureServiceTrust(ctx context.Context, name, target string) (*targettrust.Snapshot, error)
CaptureServiceTrust captures trust for a service's resolved target. the caller compares it with control's approved metadata before mutations.
func (Project) CaptureTargetTrust ¶
func (p Project) CaptureTargetTrust(ctx context.Context, name, discovered string) (*targettrust.Declaration, error)
CaptureTargetTrust captures portable CA material and a verified hostname. the declaration never depends on a local file or a runtime bundle fetch.
func (Project) ComposeFile ¶
ComposeFile resolves a configured Compose file and rejects symlink escapes. the runtime receives an absolute file path for its explicit project command.
func (Project) ComposeProject ¶
ComposeProject derives a worktree-specific Compose project name unless the target explicitly selects an existing project.
func (Project) EffectiveService ¶
func (p Project) EffectiveService(name string) (ResolvedService, error)
EffectiveService selects one binding with project identity and local settings.
func (Project) GitHubRepository ¶
GitHubRepository infers only github.com origins. source identity remains a separate checkout-independent contract and never carries job credentials.
func (Project) LocalPublicationIdentity ¶
func (p Project) LocalPublicationIdentity() LocalPublicationIdentity
func (Project) LocalWorktreeKey ¶
LocalWorktreeKey identifies this project directory without sending local paths to control. server, team and source identity remain separate scope checks.
func (Project) ResolvePublish ¶
ResolvePublish finishes target discovery for the captured deployment.
func (Project) SelectDeployment ¶
SelectDeployment materializes one captured selection without changing another handle or evaluating configuration again. local discovery defaults stay local.
func (Project) Snapshot ¶
Snapshot transfers an already evaluated configuration to a connector owner. it stays in the private process pipe; metadata and journals never contain it.
func (Project) SourceIdentity ¶
func (p Project) SourceIdentity(ctx context.Context) (SourceIdentity, error)
type ProjectContext ¶
type ProjectContext struct {
RelativeDirectory string `json:"relativeDirectory"`
}
type ResolvedService ¶
type ResolvedService struct {
config.Service
Server *string
Team *string
Feedback *bool
OAuth bool
Publish *config.Publish
Webhooks map[string]config.Webhook
}
ResolvedService contains inherited settings for one service, not a parsed project document. target discovery and trust resolution happen separately.
type SourceIdentity ¶
type SourceIdentity struct {
Key string
Fingerprint string
Label string
Source naming.GitProjectSource
}
SourceIdentity is independent of checkout directory, branch and client state. the full fingerprint lets control reject a project-key collision.
type Worktree ¶
type Worktree struct {
Root string `json:"root"`
Name string `json:"name"`
Label WorktreeLabel `json:"label"`
IsGit bool `json:"isGit"`
// contains filtered or unexported fields
}
func ApplyWorktreeHashSalt ¶
func ResolveWorktree ¶
ResolveWorktree returns project facts and falls back to cwd when Git is unavailable or cwd is not inside a worktree. ApplyWorktreeHashSalt adds the client-state-specific label used in public hostnames.
func (Worktree) PrimaryCheckoutRoot ¶
PrimaryCheckoutRoot returns the primary Git checkout shared by linked worktrees.
type WorktreeLabel ¶
type WorktreeLabel struct {
Project string `json:"project"`
Checkout string `json:"checkout,omitempty"`
ID string `json:"id"`
FullLabel string `json:"fullLabel"`
}
WorktreeLabel exposes the DNS-safe pieces used in the finished label. the primary checkout has no checkout component.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
package githubmetadata resolves immutable repository metadata during trusted apply.
|
package githubmetadata resolves immutable repository metadata during trusted apply. |
|
package projectinit owns project initialization planning, safe edits, and project-local dependency installation.
|
package projectinit owns project initialization planning, safe edits, and project-local dependency installation. |
|
Package projectmeta validates and writes browser-safe project metadata.
|
Package projectmeta validates and writes browser-safe project metadata. |
|
package resolve composes project selection with client state and current server facts.
|
package resolve composes project selection with client state and current server facts. |
|
package sourcestate records bounded Git identifiers without saving source files.
|
package sourcestate records bounded Git identifiers without saving source files. |
|
package workloadmanifest owns the nonsecret build-to-runtime workload context.
|
package workloadmanifest owns the nonsecret build-to-runtime workload context. |
|
package workloadsetup owns trusted workload setup and stable provider bindings.
|
package workloadsetup owns trusted workload setup and stable provider bindings. |