Documentation
¶
Index ¶
- func AppendSubsectionTarget(doc Document, node SectionNode, inserted string) (PatchTarget, Status)
- func StableInsertionTarget(doc Document, tmpl *Template, target TemplateSection, inserted string) (PatchTarget, Status)
- type BuildInput
- type Candidate
- type Config
- type Document
- type Input
- type Mode
- type PatchTarget
- type Placeholder
- type Result
- type SectionNode
- type Status
- type Template
- type TemplateSection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendSubsectionTarget ¶
func AppendSubsectionTarget(doc Document, node SectionNode, inserted string) (PatchTarget, Status)
func StableInsertionTarget ¶
func StableInsertionTarget(doc Document, tmpl *Template, target TemplateSection, inserted string) (PatchTarget, Status)
Types ¶
type BuildInput ¶
type Candidate ¶
type Candidate struct {
SourceIssueID string // exactly one current issue that sources this candidate
SourceQuestionIDs []string
Template string
Section string
// TargetLine is the 1-based target line in the current spec. Zero means unknown.
TargetLine int
Status Status
Text string
Before string
After string
Severity schema.Severity
SectionOrder int
}
func GenerateCandidates ¶
type Document ¶
type Document struct {
Raw string
Lines []string
Sections []SectionNode
PrimaryLevel int
}
func AnalyzeSections ¶
type Mode ¶
type Mode string
const ( ModeAuto Mode = schema.CompletionModeAuto ModeOn Mode = schema.CompletionModeOn ModeOff Mode = schema.CompletionModeOff )
type PatchTarget ¶
type Placeholder ¶
type Result ¶
type Result struct {
Candidates []Candidate
Patches []schema.Patch
Meta schema.CompletionMeta
}
func BuildResult ¶
func BuildResult(input BuildInput) (Result, []schema.Issue, error)
type SectionNode ¶
type SectionNode struct {
Heading string
Level int
StartLine int
EndLine int
BodyStart int
Parent int
}
func IncompleteSections ¶
func IncompleteSections(doc Document, tmpl *Template) []SectionNode
type Status ¶
type Status string
const ( StatusPatchGenerated Status = "patch_generated" StatusSkippedNoSafeLocation Status = "skipped_no_safe_location" StatusSkippedOverlap Status = "skipped_overlap" StatusSkippedRedaction Status = "skipped_redaction" StatusSkippedLimit Status = "skipped_limit" StatusSkippedOpenDecisionsDisabled Status = "skipped_open_decisions_disabled" )
type Template ¶
type Template struct {
Name string
Sections []TemplateSection
}
type TemplateSection ¶
type TemplateSection struct {
Heading string
Subheadings []string
Placeholders []Placeholder
Categories []schema.Category
PreflightRuleIDs []string
Order int
}
func MissingSections ¶
func MissingSections(doc Document, tmpl *Template) []TemplateSection
Click to show internal directories.
Click to hide internal directories.