Documentation
¶
Overview ¶
Package discover reads application metadata and proposes deployment settings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigValue ¶
ConfigValue reads the highest precedence scalar without exposing an entire secret-bearing config.
Types ¶
type App ¶
type App struct {
Name string `json:"name"`
Dir string `json:"dir"`
MainPath string `json:"main_path"`
Module string `json:"module"`
Type string `json:"type"` // from cmd/<app>/.forge.yaml app.type, "" if absent
Port int `json:"port"` // from dev.port, 0 if absent
ConfigPaths []string `json:"config_paths"` // existing config files for this app
Imports []string `json:"imports"` // module paths from go list -deps, deduplicated
}
type Confidence ¶
type Confidence string
const ( High Confidence = "high" // from config Medium Confidence = "medium" // from per-app .forge.yaml Low Confidence = "low" // from imports only )
type Result ¶
type Result struct {
Runtime []RuntimeReport `json:"runtime,omitempty"`
Apps []App `json:"apps"`
Suggestions []Suggestion `json:"suggestions"`
Modules []catalog.Module `json:"modules"`
Diagnostics output.Diagnostics `json:"diagnostics"`
}
type RuntimeReport ¶
type RuntimeReport struct {
Service string `json:"service,omitempty"`
Schema string `json:"schema"`
App string `json:"app"`
Requirements []RuntimeRequirement `json:"requirements"`
}
type RuntimeRequirement ¶
type Suggestion ¶
type Suggestion struct {
Kind SuggestionKind `json:"kind"`
Path string `json:"path"` // the spec path it would set, e.g. "deploy.services.api.kind"
Value any `json:"value"`
Source string `json:"source"` // "config/api.yaml:14" or "go.mod: github.com/xraph/grove/drivers/pgdriver"
Confidence Confidence `json:"confidence"`
Question string `json:"question"` // set for decisions
Options []string `json:"options"` // for decisions
}
func Block ¶
func Block(suggestions []Suggestion, defaults spec.Defaults) (map[string]any, []Suggestion)
Block renders suggestions as a complete deploy: v2 map. Decisions that are unanswered are left out and returned.
type SuggestionKind ¶
type SuggestionKind string
const ( SuggestService SuggestionKind = "service" SuggestResource SuggestionKind = "resource" SuggestBinding SuggestionKind = "binding" SuggestDecision SuggestionKind = "decision" )
Click to show internal directories.
Click to hide internal directories.