Documentation
¶
Overview ¶
Package repoplan turns detected workspace packages into a read-only import plan: one proposed app per package, with collisions and risks flagged. Building a plan never creates anything.
Index ¶
Constants ¶
View Source
const ( KindDockerfile = "dockerfile" KindBuildpack = "buildpack" KindStatic = "static" )
Build kinds a plan row can propose.
View Source
const ( WarnNoDockerfile = "no_dockerfile" WarnNoPort = "no_port" WarnDuplicatePort = "duplicate_port" WarnDuplicateName = "duplicate_name" WarnNameTaken = "name_taken" WarnPackageCap = "package_cap" WarnNoWorkspace = "no_workspace" WarnTruncated = "tree_truncated" WarnDetectFailed = "detect_failed" )
Warning codes a dashboard can translate.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Detection ¶
Detection is what per-package analysis found. Failed is set when the package could not be analyzed; the row then carries a warning.
type Input ¶
type Input struct {
RepoURL string
Branch string
BaseDirectory string
Tool string
Packages []Package
// Found is the member count before the cap; Cap is the cap that applied.
Found, Cap int
Truncated bool
// Detect maps a package directory to its detection.
Detect map[string]Detection
// Existing holds app names already taken.
Existing map[string]bool
// NameFor proposes a name for a package directory.
NameFor func(dir string) string
// MaxNameLen bounds suffixed names.
MaxNameLen int
}
Input is everything Build needs; detection and name lookup are done by the caller.
type Package ¶
type Package struct {
PackageName string
Dir string
Dockerfile string
DependsOn []string
WatchPaths []string
}
Package is one workspace member as detected, before any naming.
type Plan ¶
type Plan struct {
RepoURL string `json:"repo_url"`
Branch string `json:"branch"`
BaseDirectory string `json:"base_directory,omitempty"`
Tool string `json:"tool,omitempty"`
PackageCap int `json:"package_cap"`
PackagesFound int `json:"packages_found"`
Packages []Row `json:"packages"`
Warnings []Warning `json:"warnings"`
Totals Totals `json:"totals"`
}
Plan is the read-only result of planning one repository import.
type Row ¶
type Row struct {
Name string `json:"name"`
PackageName string `json:"package_name"`
Directory string `json:"directory"`
Port *int `json:"port"`
PortSource string `json:"port_source,omitempty"`
BuildKind string `json:"build_kind"`
Dockerfile string `json:"dockerfile,omitempty"`
WatchPaths []string `json:"watch_paths"`
DependsOn []string `json:"depends_on"`
Warnings []Warning `json:"warnings"`
}
Row is one proposed app.
Click to show internal directories.
Click to hide internal directories.