Documentation
¶
Overview ¶
Package reposcan detects the language stack, container image, and setup commands for a local repository. It backs the `circleci repo scan` command and is also reusable by other commands that need detection.
Index ¶
Constants ¶
const StackUnknown = "unknown"
StackUnknown is the sentinel value used by scan backends when no supported stack is detected.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EnvBuilderScanner ¶
type EnvBuilderScanner struct{}
EnvBuilderScanner detects the stack and setup commands for a repository using chunk-cli's env-builder library. It may make network calls (e.g. to Docker Hub) while resolving image versions, so callers should pass a context with a timeout if they need to bound the operation.
func NewDefaultScanner ¶
func NewDefaultScanner() *EnvBuilderScanner
NewDefaultScanner returns an EnvBuilderScanner ready for use.
type Result ¶
type Result struct {
Stack string `json:"stack"`
Image string `json:"image"`
ImageVersion string `json:"image_version"`
Setup []SetupStep `json:"setup"`
}
Result is the outcome of a repo scan. It is intentionally decoupled from any specific scan backend so the CLI can render and reason about it without importing the backend's types.
func (*Result) IsEmpty ¶
IsEmpty reports whether the scan failed to identify a supported stack. A nil receiver counts as empty so callers can render the fallback path without an extra nil-guard.
func (*Result) SetupCommand ¶
SetupCommand returns the command for the named setup step, or an empty string if the scan did not produce that step.