Documentation
¶
Index ¶
- Constants
- Variables
- func AddCreateFlags(cmd *cobra.Command, options ...CreateOption)
- func AddDrupalRootfsFlag(cmd *cobra.Command, target *string, defaultValue string)
- func AddReportFlags(cmd *cobra.Command, verboseTarget *bool, formatTarget *string)
- func AddReviewFlags(cmd *cobra.Command, reportTarget, verboseTarget *bool, formatTarget *string)
- func BuildReviewQuestion(view ReviewView) string
- func DriftCheckLines(view ReviewView) []string
- func ParseStateOverrides(values map[string]string) (map[string]State, error)
- func PromptChoice(name string, choices []Choice, defaultValue string, input InputFunc, ...) (string, error)
- func PromptCreateFollowUps(cmd *cobra.Command, option CreateOption, decision *ReviewDecision, ...) error
- func PromptDeclaredReviewFollowUps(view ReviewView, decision *ReviewDecision, input InputFunc, ...) error
- func PromptFollowUp(componentName string, spec FollowUpSpec, defaultValue string, input InputFunc, ...) (string, error)
- func RenderChecklistItem(label, state, detail string) string
- func RenderCommandBlock(text string) string
- func RenderComponentStatus(view ReviewView) string
- func RenderConfiguredFollowUps(view ReviewView) []string
- func RenderCurrentGuidance(view ReviewView) string
- func RenderDecisionFollowUps(def Definition, decision ReviewDecision) string
- func RenderFollowUpSection(componentName string, spec FollowUpSpec) string
- func RenderIntroSection(title, body string) string
- func RenderMigrationImpact(migration DataMigrationRequirement) string
- func RenderPromptLine(text string) string
- func RenderReviewSummary(views []ReviewView, decisions map[string]ReviewDecision, ...) (string, error)
- func RenderSection(title, body string) string
- func RenderTransitionSummary(behavior TransitionBehavior) string
- func ResolveCreateDecisions(cmd *cobra.Command, input InputFunc, options ...CreateOption) (map[string]ReviewDecision, error)
- func ResolveCreateStates(cmd *cobra.Command, input InputFunc, options ...CreateOption) (map[string]State, error)
- func RunReview(views []ReviewView, opts ReviewOptions) (map[string]ReviewDecision, error)
- func WriteComponentStatusReport(out io.Writer, views []ReviewView, verbose bool) error
- func WriteComponentStatusReportWithFormat(out io.Writer, views []ReviewView, verbose bool, format string) error
- func WriteDriftDetails(out io.Writer, status ComponentStatus)
- type ApplyOptions
- type Behavior
- type Choice
- type Component
- type ComponentSpec
- type ComponentStatus
- type ComposeDefinitions
- type ComposeFile
- func (c *ComposeFile) AddSectionEntryBlock(section, key, block string) error
- func (c *ComposeFile) AddServiceBlock(name, block string) error
- func (c *ComposeFile) AddVolumeBlock(name, block string) error
- func (c *ComposeFile) DeleteSectionEntry(section, key string) error
- func (c *ComposeFile) DeleteService(name string) error
- func (c *ComposeFile) DeleteServiceEnv(service, key string) error
- func (c *ComposeFile) DeleteServiceKey(service, key string) error
- func (c *ComposeFile) DeleteVolume(name string) error
- func (c *ComposeFile) HasService(name string) bool
- func (c *ComposeFile) HasVolume(name string) bool
- func (c *ComposeFile) Save() error
- func (c *ComposeFile) SectionEntryBlock(section, key string) (string, bool)
- func (c *ComposeFile) ServiceBlock(name string) (string, bool)
- func (c *ComposeFile) SetServiceEnv(service, key, value string) error
- func (c *ComposeFile) SetServiceStringList(service, key string, values []string) error
- func (c *ComposeFile) VolumeBlock(name string) (string, bool)
- type ComposeProject
- func (c *ComposeProject) AddDefinitions(defs *ComposeDefinitions)
- func (c *ComposeProject) Bytes() ([]byte, error)
- func (c *ComposeProject) DeleteDefinition(section, name string) bool
- func (c *ComposeProject) PruneUnusedResources()
- func (c *ComposeProject) RemoveService(name string) bool
- func (c *ComposeProject) SetDefinition(section, name string, value any)
- type ComposeSpec
- type CreateOption
- type DataMigrationRequirement
- type Definition
- func (d Definition) ComposerPackagesForEnable() []string
- func (d Definition) CreateOption() CreateOption
- func (d Definition) DrupalModulesForEnable() []DrupalModuleDependency
- func (d Definition) FollowUpsForDisposition(disposition Disposition) []FollowUpSpec
- func (d Definition) FollowUpsForState(state State) []FollowUpSpec
- func (d Definition) StrictComposerPackages() []string
- func (d Definition) StrictDrupalModules() []DrupalModuleDependency
- type DeleteMapEntriesTransform
- type Dependencies
- type DetectOptions
- type DetectedState
- type Disposition
- func LegacyDispositionForState(allowed []Disposition, state State) Disposition
- func ParseDisposition(value string) (Disposition, error)
- func PromptDisposition(name string, guidance StateGuidance, allowed []Disposition, ...) (Disposition, error)
- func ResolveAllowedDisposition(allowed []Disposition, disposition Disposition) (Disposition, error)
- func ReviewDefaultDisposition(view ReviewView) Disposition
- func StateToDisposition(state State) Disposition
- type DomainSpec
- type DrupalConfigSet
- func (d *DrupalConfigSet) DeleteFiles(names ...string)
- func (d *DrupalConfigSet) DeleteMapEntries(match MapEntryMatch) error
- func (d *DrupalConfigSet) ReplaceString(old, new string)
- func (d *DrupalConfigSet) Save(ctx *config.Context) error
- func (d *DrupalConfigSet) UpsertFile(name string, data []byte)
- type DrupalLayout
- type DrupalModuleDependency
- type DrupalModuleDependencyMode
- type DrupalSpec
- type DrupalTransform
- type FollowUpSpec
- type FollowUpValue
- type GateSpec
- type Hook
- type InputFunc
- type Manager
- func (m *Manager) DisableComponent(ctx context.Context, spec ComponentSpec) error
- func (m *Manager) DisableComponentWithOptions(ctx context.Context, spec ComponentSpec, opts ApplyOptions) error
- func (m *Manager) EnableComponent(ctx context.Context, spec ComponentSpec) error
- func (m *Manager) EnableComponentWithOptions(ctx context.Context, spec ComponentSpec, opts ApplyOptions) error
- func (m *Manager) ReconcileAll(ctx context.Context, states map[string]State, opts ApplyOptions, ...) error
- func (m *Manager) ReconcileComponent(ctx context.Context, feature Component, state State, opts ApplyOptions) error
- type MapEntryMatch
- type PromptChoiceFunc
- type PromptDispositionFunc
- type PromptStateFunc
- type Registry
- type ReplaceStringsTransform
- type RepoSource
- type ReportRow
- type ReviewConfirmFunc
- type ReviewDecision
- type ReviewMode
- type ReviewOptions
- type ReviewPromptExtraFunc
- type ReviewView
- type RuleCheckResult
- type RuleOp
- type Runtime
- type State
- type StateCheck
- type StateGuidance
- type StaticComponent
- type StringReplacement
- type SummaryLineFunc
- type TransitionBehavior
- type YAMLDocument
- type YAMLRule
- type YAMLStateSpec
Constants ¶
View Source
const ( ReportFormatSection = "section" ReportFormatTable = "table" ReportFormatJSON = "json" ReportFormatYAML = "yaml" )
View Source
const DefaultDrupalRootfs = "."
Variables ¶
View Source
var ErrActionCancelled = errors.New("component action cancelled")
Functions ¶
func AddCreateFlags ¶
func AddCreateFlags(cmd *cobra.Command, options ...CreateOption)
func AddDrupalRootfsFlag ¶
func AddReportFlags ¶ added in v0.7.0
func AddReviewFlags ¶ added in v0.7.0
func BuildReviewQuestion ¶ added in v0.7.0
func BuildReviewQuestion(view ReviewView) string
func DriftCheckLines ¶ added in v0.7.0
func DriftCheckLines(view ReviewView) []string
func ParseStateOverrides ¶
func PromptChoice ¶ added in v0.6.1
func PromptCreateFollowUps ¶ added in v0.8.0
func PromptCreateFollowUps(cmd *cobra.Command, option CreateOption, decision *ReviewDecision, input InputFunc) error
func PromptDeclaredReviewFollowUps ¶ added in v0.8.0
func PromptDeclaredReviewFollowUps(view ReviewView, decision *ReviewDecision, input InputFunc, promptChoice PromptChoiceFunc) error
func PromptFollowUp ¶ added in v0.8.0
func PromptFollowUp(componentName string, spec FollowUpSpec, defaultValue string, input InputFunc, promptChoice PromptChoiceFunc) (string, error)
func RenderChecklistItem ¶ added in v0.6.0
func RenderCommandBlock ¶ added in v0.6.0
func RenderComponentStatus ¶ added in v0.7.0
func RenderComponentStatus(view ReviewView) string
func RenderConfiguredFollowUps ¶ added in v0.8.0
func RenderConfiguredFollowUps(view ReviewView) []string
func RenderCurrentGuidance ¶ added in v0.7.0
func RenderCurrentGuidance(view ReviewView) string
func RenderDecisionFollowUps ¶ added in v0.8.0
func RenderDecisionFollowUps(def Definition, decision ReviewDecision) string
func RenderFollowUpSection ¶ added in v0.8.0
func RenderFollowUpSection(componentName string, spec FollowUpSpec) string
func RenderIntroSection ¶ added in v0.5.4
func RenderMigrationImpact ¶ added in v0.7.0
func RenderMigrationImpact(migration DataMigrationRequirement) string
func RenderPromptLine ¶ added in v0.5.4
func RenderReviewSummary ¶ added in v0.7.0
func RenderReviewSummary(views []ReviewView, decisions map[string]ReviewDecision, summaryLine SummaryLineFunc) (string, error)
func RenderSection ¶ added in v0.5.4
func RenderTransitionSummary ¶ added in v0.7.0
func RenderTransitionSummary(behavior TransitionBehavior) string
func ResolveCreateDecisions ¶ added in v0.8.0
func ResolveCreateDecisions(cmd *cobra.Command, input InputFunc, options ...CreateOption) (map[string]ReviewDecision, error)
func ResolveCreateStates ¶
func RunReview ¶ added in v0.7.0
func RunReview(views []ReviewView, opts ReviewOptions) (map[string]ReviewDecision, error)
func WriteComponentStatusReport ¶ added in v0.7.0
func WriteComponentStatusReport(out io.Writer, views []ReviewView, verbose bool) error
func WriteComponentStatusReportWithFormat ¶ added in v0.7.0
func WriteDriftDetails ¶ added in v0.7.0
func WriteDriftDetails(out io.Writer, status ComponentStatus)
Types ¶
type ApplyOptions ¶
type Behavior ¶
type Behavior struct {
Idempotent bool
Enable TransitionBehavior
Disable TransitionBehavior
}
type Component ¶
type Component interface {
Name() string
DefaultState() State
SpecFor(state State) ComponentSpec
}
type ComponentSpec ¶
type ComponentSpec struct {
Name string
Gates GateSpec
Compose ComposeSpec
Drupal DrupalSpec
BeforeDisable []Hook
AfterDisable []Hook
BeforeEnable []Hook
AfterEnable []Hook
}
type ComponentStatus ¶
type ComponentStatus struct {
Name string
State DetectedState
On StateCheck
Off StateCheck
}
func DetectComponentStatus ¶
func DetectComponentStatus(ctx *config.Context, projectRoot string, def Definition, opts DetectOptions) (ComponentStatus, error)
func DetectComponentStatuses ¶
func DetectComponentStatuses(ctx *config.Context, projectRoot string, opts DetectOptions, defs ...Definition) ([]ComponentStatus, error)
type ComposeDefinitions ¶
type ComposeDefinitions struct {
Services map[string]any
Networks map[string]any
Volumes map[string]any
Secrets map[string]any
Configs map[string]any
}
func ParseComposeDefinitions ¶
func ParseComposeDefinitions(data []byte) (*ComposeDefinitions, error)
func (*ComposeDefinitions) Definition ¶ added in v0.10.0
func (d *ComposeDefinitions) Definition(section, name string) (any, bool)
type ComposeFile ¶
type ComposeFile struct {
// contains filtered or unexported fields
}
func LoadComposeFile ¶
func LoadComposeFile(path string) (*ComposeFile, error)
func LoadComposeFileOptional ¶ added in v0.9.2
func LoadComposeFileOptional(path string) (*ComposeFile, error)
func (*ComposeFile) AddSectionEntryBlock ¶ added in v0.10.0
func (c *ComposeFile) AddSectionEntryBlock(section, key, block string) error
func (*ComposeFile) AddServiceBlock ¶ added in v0.9.2
func (c *ComposeFile) AddServiceBlock(name, block string) error
func (*ComposeFile) AddVolumeBlock ¶ added in v0.9.3
func (c *ComposeFile) AddVolumeBlock(name, block string) error
func (*ComposeFile) DeleteSectionEntry ¶ added in v0.5.1
func (c *ComposeFile) DeleteSectionEntry(section, key string) error
func (*ComposeFile) DeleteService ¶ added in v0.5.1
func (c *ComposeFile) DeleteService(name string) error
func (*ComposeFile) DeleteServiceEnv ¶ added in v0.5.1
func (c *ComposeFile) DeleteServiceEnv(service, key string) error
func (*ComposeFile) DeleteServiceKey ¶ added in v0.9.2
func (c *ComposeFile) DeleteServiceKey(service, key string) error
func (*ComposeFile) DeleteVolume ¶ added in v0.5.1
func (c *ComposeFile) DeleteVolume(name string) error
func (*ComposeFile) HasService ¶ added in v0.9.2
func (c *ComposeFile) HasService(name string) bool
func (*ComposeFile) HasVolume ¶ added in v0.9.3
func (c *ComposeFile) HasVolume(name string) bool
func (*ComposeFile) Save ¶ added in v0.5.1
func (c *ComposeFile) Save() error
func (*ComposeFile) SectionEntryBlock ¶ added in v0.10.0
func (c *ComposeFile) SectionEntryBlock(section, key string) (string, bool)
func (*ComposeFile) ServiceBlock ¶ added in v0.9.2
func (c *ComposeFile) ServiceBlock(name string) (string, bool)
func (*ComposeFile) SetServiceEnv ¶ added in v0.5.1
func (c *ComposeFile) SetServiceEnv(service, key, value string) error
func (*ComposeFile) SetServiceStringList ¶ added in v0.9.2
func (c *ComposeFile) SetServiceStringList(service, key string, values []string) error
func (*ComposeFile) VolumeBlock ¶ added in v0.9.3
func (c *ComposeFile) VolumeBlock(name string) (string, bool)
type ComposeProject ¶ added in v0.5.1
type ComposeProject struct {
// contains filtered or unexported fields
}
func ParseComposeProject ¶ added in v0.5.1
func ParseComposeProject(data []byte) (*ComposeProject, error)
func (*ComposeProject) AddDefinitions ¶ added in v0.5.1
func (c *ComposeProject) AddDefinitions(defs *ComposeDefinitions)
func (*ComposeProject) Bytes ¶ added in v0.5.1
func (c *ComposeProject) Bytes() ([]byte, error)
func (*ComposeProject) DeleteDefinition ¶ added in v0.10.0
func (c *ComposeProject) DeleteDefinition(section, name string) bool
func (*ComposeProject) PruneUnusedResources ¶ added in v0.5.1
func (c *ComposeProject) PruneUnusedResources()
func (*ComposeProject) RemoveService ¶ added in v0.5.1
func (c *ComposeProject) RemoveService(name string) bool
func (*ComposeProject) SetDefinition ¶ added in v0.10.0
func (c *ComposeProject) SetDefinition(section, name string, value any)
type ComposeSpec ¶
type ComposeSpec struct {
Definitions *ComposeDefinitions
RemoveServices []string
PruneUnusedResource bool
}
type CreateOption ¶
type CreateOption struct {
Name string
Default State
DefaultDisposition Disposition
AllowedDispositions []Disposition
Guidance StateGuidance
Shorthand string
PromptOnCreate bool
FollowUps []FollowUpSpec
}
type DataMigrationRequirement ¶
type DataMigrationRequirement string
const ( DataMigrationNone DataMigrationRequirement = "none" DataMigrationBackfill DataMigrationRequirement = "backfill" DataMigrationHard DataMigrationRequirement = "hard" )
type Definition ¶
type Definition struct {
Name string
DefaultState State
DefaultDisposition Disposition
AllowedDispositions []Disposition
Guidance StateGuidance
PromptOnCreate bool
FollowUps []FollowUpSpec
Gates GateSpec
Dependencies Dependencies
Behavior Behavior
On DomainSpec
Off DomainSpec
}
func (Definition) ComposerPackagesForEnable ¶
func (d Definition) ComposerPackagesForEnable() []string
func (Definition) CreateOption ¶ added in v0.5.2
func (d Definition) CreateOption() CreateOption
func (Definition) DrupalModulesForEnable ¶
func (d Definition) DrupalModulesForEnable() []DrupalModuleDependency
func (Definition) FollowUpsForDisposition ¶ added in v0.9.0
func (d Definition) FollowUpsForDisposition(disposition Disposition) []FollowUpSpec
func (Definition) FollowUpsForState ¶ added in v0.8.0
func (d Definition) FollowUpsForState(state State) []FollowUpSpec
func (Definition) StrictComposerPackages ¶
func (d Definition) StrictComposerPackages() []string
func (Definition) StrictDrupalModules ¶
func (d Definition) StrictDrupalModules() []DrupalModuleDependency
type DeleteMapEntriesTransform ¶
type DeleteMapEntriesTransform struct {
Matches []MapEntryMatch
}
func (DeleteMapEntriesTransform) Apply ¶
func (t DeleteMapEntriesTransform) Apply(set *DrupalConfigSet) error
type Dependencies ¶
type Dependencies struct {
DrupalModules []DrupalModuleDependency
}
func (Dependencies) ComposerPackagesForEnable ¶
func (d Dependencies) ComposerPackagesForEnable() []string
func (Dependencies) DrupalModulesForEnable ¶
func (d Dependencies) DrupalModulesForEnable() []DrupalModuleDependency
func (Dependencies) StrictComposerPackages ¶
func (d Dependencies) StrictComposerPackages() []string
func (Dependencies) StrictDrupalModules ¶
func (d Dependencies) StrictDrupalModules() []DrupalModuleDependency
type DetectOptions ¶
type Disposition ¶ added in v0.9.0
type Disposition string
const ( DispositionDisabled Disposition = "disabled" DispositionSuperseded Disposition = "superceded" DispositionEnabled Disposition = "enabled" DispositionDistributed Disposition = "distributed" )
func LegacyDispositionForState ¶ added in v0.9.0
func LegacyDispositionForState(allowed []Disposition, state State) Disposition
func ParseDisposition ¶ added in v0.9.0
func ParseDisposition(value string) (Disposition, error)
func PromptDisposition ¶ added in v0.9.0
func PromptDisposition(name string, guidance StateGuidance, allowed []Disposition, defaultDisposition Disposition, input InputFunc) (Disposition, error)
func ResolveAllowedDisposition ¶ added in v0.9.0
func ResolveAllowedDisposition(allowed []Disposition, disposition Disposition) (Disposition, error)
func ReviewDefaultDisposition ¶ added in v0.9.0
func ReviewDefaultDisposition(view ReviewView) Disposition
func StateToDisposition ¶ added in v0.9.0
func StateToDisposition(state State) Disposition
type DomainSpec ¶
type DomainSpec struct {
Compose YAMLStateSpec
Drupal YAMLStateSpec
}
type DrupalConfigSet ¶
type DrupalConfigSet struct {
// contains filtered or unexported fields
}
func LoadDrupalConfigSet ¶
func LoadDrupalConfigSet(ctx *config.Context, root string) (*DrupalConfigSet, error)
func NewDrupalConfigSet ¶
func NewDrupalConfigSet(root string, files map[string][]byte) *DrupalConfigSet
func (*DrupalConfigSet) DeleteFiles ¶
func (d *DrupalConfigSet) DeleteFiles(names ...string)
func (*DrupalConfigSet) DeleteMapEntries ¶
func (d *DrupalConfigSet) DeleteMapEntries(match MapEntryMatch) error
func (*DrupalConfigSet) ReplaceString ¶
func (d *DrupalConfigSet) ReplaceString(old, new string)
func (*DrupalConfigSet) UpsertFile ¶
func (d *DrupalConfigSet) UpsertFile(name string, data []byte)
type DrupalLayout ¶
type DrupalLayout struct {
Root string
}
func ResolveDrupalLayout ¶
func ResolveDrupalLayout(projectRoot, drupalRoot string) DrupalLayout
func (DrupalLayout) ComposerJSONPath ¶
func (l DrupalLayout) ComposerJSONPath() string
func (DrupalLayout) ConfigSyncDir ¶
func (l DrupalLayout) ConfigSyncDir() string
type DrupalModuleDependency ¶
type DrupalModuleDependency struct {
Module string
ComposerPackage string
Mode DrupalModuleDependencyMode
}
type DrupalModuleDependencyMode ¶
type DrupalModuleDependencyMode string
const ( // DrupalModuleDependencyStrict means the module is part of the component's // core contract and should stay aligned with the component state. DrupalModuleDependencyStrict DrupalModuleDependencyMode = "strict" // DrupalModuleDependencyEnableOnly means the module must exist when the // component is enabled, but disabling the component does not imply removing // or uninstalling the module. DrupalModuleDependencyEnableOnly DrupalModuleDependencyMode = "enable_only" )
type DrupalSpec ¶
type DrupalSpec struct {
ConfigSyncDir string
Files map[string][]byte
DeleteFiles []string
DisableTransforms []DrupalTransform
EnableTransforms []DrupalTransform
}
type DrupalTransform ¶
type DrupalTransform interface {
Apply(*DrupalConfigSet) error
}
type FollowUpSpec ¶ added in v0.8.0
type FollowUpValue ¶ added in v0.8.0
type FollowUpValue struct {
Value string
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) DisableComponent ¶
func (m *Manager) DisableComponent(ctx context.Context, spec ComponentSpec) error
func (*Manager) DisableComponentWithOptions ¶
func (m *Manager) DisableComponentWithOptions(ctx context.Context, spec ComponentSpec, opts ApplyOptions) error
func (*Manager) EnableComponent ¶
func (m *Manager) EnableComponent(ctx context.Context, spec ComponentSpec) error
func (*Manager) EnableComponentWithOptions ¶
func (m *Manager) EnableComponentWithOptions(ctx context.Context, spec ComponentSpec, opts ApplyOptions) error
func (*Manager) ReconcileAll ¶
func (*Manager) ReconcileComponent ¶
type MapEntryMatch ¶
type PromptChoiceFunc ¶ added in v0.8.0
type PromptDispositionFunc ¶ added in v0.9.0
type PromptDispositionFunc func(name string, guidance StateGuidance, allowed []Disposition, defaultDisposition Disposition, input InputFunc) (Disposition, error)
type PromptStateFunc ¶ added in v0.7.0
type PromptStateFunc func(name string, guidance StateGuidance, input InputFunc) (State, error)
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func (*Registry) Components ¶
func (*Registry) MustRegister ¶
type ReplaceStringsTransform ¶
type ReplaceStringsTransform struct {
Replacements []StringReplacement
}
func (ReplaceStringsTransform) Apply ¶
func (t ReplaceStringsTransform) Apply(set *DrupalConfigSet) error
type RepoSource ¶
type ReportRow ¶ added in v0.7.0
type ReportRow struct {
Name string `json:"name" yaml:"name"`
State string `json:"state" yaml:"state"`
DetectedMode string `json:"detected_mode,omitempty" yaml:"detected_mode,omitempty"`
FollowUps map[string]string `json:"follow_ups,omitempty" yaml:"follow_ups,omitempty"`
CurrentGuidance string `json:"current_guidance,omitempty" yaml:"current_guidance,omitempty"`
IfEnabled string `json:"if_enabled" yaml:"if_enabled"`
IfDisabled string `json:"if_disabled" yaml:"if_disabled"`
DriftDetail string `json:"drift_detail,omitempty" yaml:"drift_detail,omitempty"`
DriftChecks []string `json:"drift_checks,omitempty" yaml:"drift_checks,omitempty"`
}
func BuildComponentStatusRows ¶ added in v0.7.0
func BuildComponentStatusRows(views []ReviewView, verbose bool) []ReportRow
type ReviewConfirmFunc ¶ added in v0.7.0
type ReviewDecision ¶ added in v0.7.0
type ReviewDecision struct {
Disposition Disposition
State State
Options map[string]string
}
type ReviewMode ¶ added in v0.7.0
type ReviewOptions ¶ added in v0.7.0
type ReviewOptions struct {
Input InputFunc
PromptState PromptStateFunc
PromptDisposition PromptDispositionFunc
PromptChoice PromptChoiceFunc
PromptExtra ReviewPromptExtraFunc
SummaryLine SummaryLineFunc
Confirm ReviewConfirmFunc
}
type ReviewPromptExtraFunc ¶ added in v0.7.0
type ReviewPromptExtraFunc func(view ReviewView, decision *ReviewDecision) error
type ReviewView ¶ added in v0.7.0
type ReviewView struct {
Definition Definition
Name string
State DetectedState
Disposition Disposition
Detail string
DriftDetail string
SDKStatus *ComponentStatus
FollowUpValues map[string]string
Extra any
}
type RuleCheckResult ¶
type State ¶
type State string
func DispositionToState ¶ added in v0.9.0
func DispositionToState(disposition Disposition) State
func ParseState ¶
func PromptState ¶
func PromptState(name string, guidance StateGuidance, input InputFunc) (State, error)
func ReviewDefaultState ¶ added in v0.7.0
func ReviewDefaultState(view ReviewView) State
type StateCheck ¶
type StateCheck struct {
State State
Passed int
Failed int
Results []RuleCheckResult
}
type StateGuidance ¶
type StaticComponent ¶
type StaticComponent struct {
// contains filtered or unexported fields
}
func NewStaticComponent ¶
func NewStaticComponent(name string, defaultState State, on ComponentSpec, off ComponentSpec) StaticComponent
func (StaticComponent) DefaultState ¶
func (f StaticComponent) DefaultState() State
func (StaticComponent) Name ¶
func (f StaticComponent) Name() string
func (StaticComponent) SpecFor ¶
func (f StaticComponent) SpecFor(state State) ComponentSpec
type StringReplacement ¶
type SummaryLineFunc ¶ added in v0.7.0
type SummaryLineFunc func(view ReviewView, decision ReviewDecision) (string, error)
type TransitionBehavior ¶
type TransitionBehavior struct {
DataMigration DataMigrationRequirement
Summary string
}
type YAMLDocument ¶
type YAMLDocument struct {
// contains filtered or unexported fields
}
func LoadYAMLDocument ¶
func LoadYAMLDocument(data []byte) (*YAMLDocument, error)
func (*YAMLDocument) Bytes ¶
func (d *YAMLDocument) Bytes() ([]byte, error)
func (*YAMLDocument) DeletePath ¶
func (d *YAMLDocument) DeletePath(path string) error
func (*YAMLDocument) SetString ¶
func (d *YAMLDocument) SetString(path, value string) error
type YAMLStateSpec ¶
type YAMLStateSpec struct {
Canonical []RepoSource
Rules []YAMLRule
}
Click to show internal directories.
Click to hide internal directories.